phlipper / chef-monit

Chef cookbook for monit package
http://phlippers.net/chef-monit
MIT License
67 stars 69 forks source link

Fix bug in which Monit is not started during bootstrap #38

Closed evan2645 closed 10 years ago

evan2645 commented 10 years ago

I ran into this bug in which Monit never actually starts when bootstrapping a new node. Most of the craziness is obscured due to the fact that both 'monit reload' and '/etc/init.d/monit start' report exit status 0 after failure (examples below). This causes chef to believe Monit is running.

This fix includes two modifications:

Supplemental proof of Monit silliness:

vagrant@box01:~$ sudo /etc/init.d/monit start
Starting daemon monitor: monit won't be started/stopped
unless it it's configured
please configure monit and then edit /etc/default/monit
and set the "startup" variable to 1 in order to allow
monit to start
vagrant@box01:~$ echo $?
0
vagrant@box01:~$
vagrant@box01:~$
vagrant@box01:~$ sudo monit reload
monit: generated unique Monit id 6fa3ee32626bfa5e4776aa641fc2241a and stored to '/root/.monit.id'
Reinitializing monit daemon
monit: No daemon process found
vagrant@box01:~$ echo $?
0
esigler commented 10 years ago

:+1:

alanivey commented 10 years ago

:+1:

phlipper commented 10 years ago

@evan2645 thank you very much for this!