我正在尝试让monit在CentOS服务器上重启我的sidekiq服务。在尝试了多种解决方案后,我被难住了,仍然无法启动服务。
来自monit.d.d的我的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如果我手动运行start program命令,它会很好地启动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所以它包含了文件,但是不知何故没有设法从脚本启动服务。
那会是什么呢?某种权限问题吗?
发布于 2015-10-22 12:02:07
您需要更新到Monit的最新版本(5.14)。删除当前的monit安装,并按照以下说明操作:
https://rtcamp.com/tutorials/monitoring/monit/
希望它能帮上忙!
PS:在这里找到了解决方案:https://bitbucket.org/tildeslash/monit/issues/109/failed-to-stop-always-after-60-seconds
发布于 2016-05-11 21:29:33
根据Debugging monit的说法
我发现我需要设置路径。
我的启动程序:
PATH=/home/vagrant/.rbenv/shims:/home/vagrant/.rbenv/bin:$PATH /home/vagrant/apps/skylark/shared/tmp/pids/sidekiq.pid /home/vagrant/apps/skylark/shared/log/sidekiq.log'
-c exec sidekiq -d -e production -C -P -L /home/vagrant/apps/skylark/shared/log/sidekiq.log‘
发布于 2018-07-31 03:59:52
我认为问题出在你的用户身上。您需要使用deploy user执行。
check process sidekiq
with pidfile /var/www/App/tmp/pids/sidekiq.pid
start program = "/bin/su - deploy -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/su - deploy -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 timeouthttps://stackoverflow.com/questions/32968215
复制相似问题