简体   繁体   中英

Monit and private_pub

to start the thin server with monit is just start program = "/etc/init.d/thin start"

but to start private_pub or faye is needed to bundle the rackup.

and how to stop the pid?

someone have a idea?

check process  private_pub_myapp
  with pidfile "/home/ubuntu/myapp/shared/tmp/pids/private_pub.pid"
  start program = "bundle exec rackup /home/ubuntu/myapp/shared/config/private_pub.ru -s thin -E production" with timeout 90 seconds

  stop program = "kill -s TERM `cat /home/ubuntu/myapp/shared/config/private_pub.yml`" with timeout 90 seconds
  if totalmem is greater than 200 MB for 2 cycles then restart # eating up memory?
  group private_pub_myapp

monit spitting out

/conf.d/private_pub.conf:3: Warning: Program does not exist: 'bundle' /etc/monit/conf.d/private_pub.conf:5: Warning: Program does not exist: 'kill'

You always need to give a full, absolute path when using Monit. For example start program = "/usr/local/bin/bundle exec ..." and similar. That said, I suspect this still won't work. You seem to be trying to cat the config YAML to find the PID to kill which is probably a copy-paste issue and you'll need to make sure your rackup config is actually writing out the PID file.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM