I am using monit gem to monitor my sidekiq process My Monitrc config file:-
check process sidekiq_process with pidfile /home/path_to_pid
start program = "bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml -e development" with timeout 60 seconds
stop program = "bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml -e development"
My sidekiq.yml file:-
development:
:pidfile: tmp/pids/sidekiq_development.pid
:logfile: log/sidekiq_development.log
:concurrency: 1
After running sidekiq using bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml -e development
and then running sudo monit
, sudo monit status
gives me this:-
Process 'sidekiq_process'
status Running
monitoring status Monitored
pid 10951
parent pid 1378
uid 1000
effective uid 1000
gid 1000
uptime 0m
threads 2
children 0
memory 103.4 MB
memory total 103.4 MB
memory percent 1.3%
memory percent total 1.3%
cpu percent 0.0%
cpu percent total 0.0%
data collected Mon, 13 Aug 2018 12:14:06
So, it is monitoring fine, it even sends me mail "Does not exist" when I kill the sidekiq process, but the problem is after sidekiq process is killed, it should also restart the process. Here is what sudo monit status
gives me after sidekiq is killed
Process 'sidekiq_process'
status Execution failed
monitoring status Monitored
data collected Mon, 13 Aug 2018 12:19:13
I also get mail stating "Execution Failed".
Why am I getting execution failed error and why process is not being restarted by monit?
将您的exec命令包装在shell脚本中,并对其进行chmod + x,然后在此处检查我的答案
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.