我在嘗試設置Monit來管理Resque工作人員,但未能開始說/home/deployer/.rbenv/shims/bundle: line 4: exec: rbenv: not found
我檢查到它運行的命令爲deployer
用戶,如果我複製並粘貼該命令直接通過SSH一切正常。以下是我的Monit配置。謝謝!在RBenv設置下用Monit管理Resque工人
check process resque_worker_1 with pidfile CURRENT_PATH/tmp/pids/resque_worker_1.pid start program = "/usr/bin/env HOME=/home/deployer RACK_ENV=production PATH=/home/deployer/.rbenv/shims:/usr/local/bin:/usr/local/ruby/bin:/usr/bin:/bin:$PATH /bin/sh -l -c 'cd CURRENT_PATH; bundle exec rake environment resque:work RAILS_ENV=production QUEUE=high,normal,low VERBOSE=1 PIDFILE=CURRENT_PATH/tmp/pids/resque_worker_1.pid >> CURRENT_PATH/log/resque_worker_.log 2>&1'" as uid deployer and gid admin stop program = "/bin/sh -c 'cd CURRENT_PATH && kill -9 $(cat tmp/pids/resque_worker_1.pid) && rm -f tmp/pids/resque_worker_1.pid; exit 0;'" as uid deployer and gid admin if totalmem is greater than 300 MB for 10 cycles then restart # eating up memory? group resque_workers