ajgon / opsworks_ruby

Set of chef recipes for OpsWorks based Ruby projects.
MIT License
82 stars 94 forks source link

monit restart not really restarting services on deploy #29

Closed phongsi closed 8 years ago

phongsi commented 8 years ago

Currently, sidekiq on deploy is doing a monit reload before doing a monit restart https://github.com/ajgon/opsworks_ruby/blob/master/libraries/drivers_worker_sidekiq.rb#L14

This does not restart the sidekiq service. Here is a log.

Aug 23 18:07:49 ip-10-0-10-61 monit[7095]: Reinitializing monit - Control file '/etc/monit.conf'
Aug 23 18:07:49 ip-10-0-10-61 monit[7095]: Shutting down monit HTTP server
Aug 23 18:07:50 ip-10-0-10-61 monit[7095]: restart service 'sidekiq_blahblah-1' on user request
Aug 23 18:07:50 ip-10-0-10-61 monit[7095]: monit daemon at 7095 awakened
Aug 23 18:07:50 ip-10-0-10-61 monit[7095]: monit HTTP server stopped
Aug 23 18:07:50 ip-10-0-10-61 monit[7095]: Starting monit HTTP server at [localhost:2812]
Aug 23 18:07:50 ip-10-0-10-61 monit[7095]: monit HTTP server started
Aug 23 18:07:50 ip-10-0-10-61 monit[7095]: 'system_ip-10-0-10-61.localdomain' Monit reloaded

When checking the process timestamps, i realize sidekiq didnt restart.

I suspect it might be because the http service for monit is shut down when the restart service command is issued. From the documentation, command line features are disabled when the http service is disabled https://mmonit.com/monit/documentation/monit.html#MONIT-HTTPD.

I feel like reloading monit is only necessary when monit itself has some configuration changes.

suggestions, advice, thoughts?

ajgon commented 8 years ago

Resolved in #33