问题是当我将 monit 与 capistrano 一起使用时。我的错误是什么?
INFO [843c196b] Running /usr/bin/env sudo mv /tmp/monit.conf /etc/monit/conf.d/sidekiq_admin-api_production.conf as deployer@XXXXXXXXXX
DEBUG [843c196b] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.3 /usr/bin/env sudo mv /tmp/monit.conf /etc/monit/conf.d/sidekiq_admin-api_production.conf )
DEBUG [843c196b] sudo: no tty present and no askpass program specified
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deployer@XXXXXXXXXX: sudo exit status: 1
sudo stdout: Nothing written
sudo stderr: sudo: no tty present and no askpass program specified
我尝试了 ssh 密钥授权。
更改我的用户的文件夹权限(/tmp/monit.conf /etc/monit/conf.d/)
设置:pty,假
设置:use_sudo,假
须藤文件
我的 sudo 文件是:
# User privilege specification
root ALL=(ALL:ALL) ALL
deployer ALL=(ALL) NOPASSWD:ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL