Pat Maddox pergesu at gmail.com
Fri May 4 04:56:51 PDT 2007
On 5/4/07, Pat Maddox <pergesu at gmail.com> wrote:
> I'm using monit to handle a number of our services, and want to use it
> for slon as well.  Here's the config I've created:
>
> check process slony
>   with pidfile /var/run/slony.pid
>   start program = "/usr/local/bin/slon -p /var/run/slony.pid twistage
> 'dbname=twist_prod user=slony host=localhost' >> /var/log/slony.log &"
>   stop program = "/bin/kill -TERM `/bin/cat /var/run/slony.pid`"
>   group slony
>
> Running "monit start all" works fine and the slon daemon starts up and
> does its thing.  However I'm not able to stop slon.  monit just sits
> for a while, and then says that it failed to stop slon.  If I run the
> kill command myself from the command line though it works perfectly.
> Not sure what the difference is - how can I make slon stop using
> monit?
>
> Pat
>

I ended up doing
stop program = "/bin/sh -c '/bin/kill -s SIGTERM `/bin/cat /var/run/slony.pid`'"

instead and it works fine.

My only other question now is can I be sure that slony is still
replicating properly as long as it's running?  The docs say that older
versions were very fragile and would crash if they encountered any
problem.  That'd be fine with my setup because I'm using monit, it'd
just get restarted.  In 1.2 though it's supposedly a lot less
fragile...but under what conditions will the daemon run but not be
operating properly?  Can that happen at all?  Assume that the
configuration is okay (i.e. nothing boneheaded like forgetting to
subscribe a set).

Pat


More information about the Slony1-general mailing list