2015-10-06 109 views
0

我試圖在CentOS服務器上重新啓動我的sidekiq服務。在嘗試了多種解決方案後,我很難入手,仍然無法啓動服務。從monit.dMonit無法重新啓動sidekiq

我sidekiq文件:

check process sidekiq 
    with pidfile /var/www/App/tmp/pids/sidekiq.pid 
    start program = "/bin/bash -l -c 'sudo cd /var/www/App && bundle exec sidekiq --index 0 --pidfile /var/www/App/tmp/pids/sidekiq.pid --environment production --logfile /var/www/App/log/sidekiq.log --daemon'" as uid deploy and gid deploy 
    stop program = "/bin/bash -l -c 'cd /var/www/App && bundle exec sidekiqctl stop /var/www/App/tmp/pids/sidekiq.pid 10'" as uid deploy and gid deploy 
    if totalmem is greater than 512 MB for 2 cycles then restart 
    if 3 restarts within 5 cycles then timeout 

如果我手動運行啓動程序的命令,它會啓動sidekiq罰款,但monit的似乎並沒有做任何事情。只是想出了:

[BST Oct 6 11:51:17] error : 'sidekiq' process is not running 
[BST Oct 6 11:51:17] info  : 'sidekiq' trying to restart 
[BST Oct 6 11:51:17] info  : 'sidekiq' start: /bin/bash 
[BST Oct 6 11:52:47] error : 'sidekiq' failed to start 

所以它是包括文件罰款,但不知何故不管理開始從腳本服務。

它可能是什麼?一些權限問題的種類?

回答

0

根據Debugging monit

我發現我需要設置PATH。

我的啓動程序:

/斌/慶典-c「坎德拉/家/流浪者/應用/雲雀/電流; PATH =/home/vagrant/.rbenv/shims:/home/vagrant/.rbenv/bin:$ PATH bundle exec sidekiq -d -e production -C -P/home/vagrant/apps/skylark/shared/tmp/pids /sidekiq.pid -L /home/vagrant/apps/skylark/shared/log/sidekiq.log'