New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

monit restart not really restarting services on deploy #29

Closed
phongsi opened this Issue Aug 23, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@phongsi
Contributor

phongsi commented Aug 23, 2016

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

This comment has been minimized.

Show comment
Hide comment
@ajgon

ajgon Aug 29, 2016

Owner

Resolved in #33

Owner

ajgon commented Aug 29, 2016

Resolved in #33

@ajgon ajgon closed this Aug 29, 2016

ajgon added a commit that referenced this issue Sep 14, 2016

fix: `monit reload` and `monit restart` order
Before this change, `monit restart` was invoked before `monit reload` which cased problems on
initial setup of an instance. The `monit restart` command was expecting already defined service,
which was in fact, configured, but not loaded by monit, since `monit reload` never occured. This
change ensures, that every time a `*.monitrc` file changes, `monit reload` is inoked.

Fixes #29 properly

ajgon added a commit that referenced this issue Sep 14, 2016

fix: `monit reload` and `monit restart` order
Before this change, `monit restart` was invoked before `monit reload` which cased problems on
initial setup of an instance. The `monit restart` command was expecting already defined service,
which was in fact, configured, but not loaded by monit, since `monit reload` never occured. This
change ensures, that every time a `*.monitrc` file changes, `monit reload` is inoked.

Fixes #29 properly

ajgon added a commit that referenced this issue Sep 14, 2016

fix: `monit reload` and `monit restart` order
Before this change, `monit restart` was invoked before `monit reload` which cased problems on
initial setup of an instance. The `monit restart` command was expecting already defined service,
which was in fact, configured, but not loaded by monit, since `monit reload` never occured. This
change ensures, that every time a `*.monitrc` file changes, `monit reload` is inoked.

Fixes #29 properly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment