tôi chỉ cấu hình Jenkins và trong pre-xây dựng bước tôi đang cố gắng để khởi động lại Jenkins nhưng tôi kết thúc với các lỗi saujenkins thất bại trong khi khởi động lại sql của tôi "sudo: no tty hiện tại và không có chương trình askpass được chỉ định Xin lỗi, thử lại."
Commencing build of Revision c5b9f8daac092efc5396d80f568a2cf89ae8b697 (origin/HEAD, origin/master)
Checking out Revision c5b9f8daac092efc5396d80f568a2cf89ae8b697 (origin/HEAD, origin/master)
No change to record in branch origin/HEAD
No change to record in branch origin/master
[webapp] $ /bin/sh -xe /tmp/hudson5215632082686866774.sh
+ sudo /etc/init.d/mysql restart
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: 3 incorrect password attempts
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Tôi googled và thấy một số câu trả lời tại Jenkins out of nowhere starts failing with sudo: no tty present and no askpass program specified
Nhưng tiếc didn rằng 't giúp tôi
My/etc/sudoers trông như thế này
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) NOPASSWD: ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
lệnh trả về id của tôi này uid = 108 (Jenkins) gid = 65534 (nogroup) nhóm = 65534 (nogroup), 111 (admin) tôi nghĩ rằng Jenkins dùng được trong nhóm admin nên sudo không phải là vấn đề. Khi bạn nói "Trong trường hợp này sudo không có tty để yêu cầu mật khẩu và do đó lỗi" chính xác thì điều đó có nghĩa là gì? Làm thế nào để tôi thêm tty? –