Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

monit restart not really restarting services on deploy #29

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

monit restart not really restarting services on deploy #29

phongsi opened this issue Aug 23, 2016 · 1 comment

Comments

@phongsi
Copy link
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
Copy link
Owner

ajgon commented Aug 29, 2016

Resolved in #33

@ajgon ajgon closed this as completed Aug 29, 2016
ajgon added a commit that referenced this issue Sep 14, 2016
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
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
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
dotnofoolin pushed a commit to dotnofoolin/opsworks_ruby that referenced this issue Nov 23, 2021
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 ajgon#29 properly
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants