Thanks Martin,
I'm trying to achieve the opposite.
If the process exists I need to stop it.

Is that possible?
Thanks,
Phil

On 11 November 2014 12:25, Martin Pala <[email protected]> wrote:

> Hi,
>
> the correct syntax is:
>
>         if DOES NOT exist then exec
> "/usr/local/monit-scripts/ruby-daemon.sh push_notification stop"
>
> Regards,
> Martin
>
>
>
> > On 11 Nov 2014, at 13:03, Phil Townes <[email protected]> wrote:
> >
> > Hi, I'm using monit 5.10 on Centos 6.4.
> > I'm trying to check that a process is NOT running on a server.
> > If the process is running I need to stop it.
> >
> > I've tried the following monit config:
> >
> > # Push Notification - SHOULD NOT BE RUNNING
> > check process Push_Notification_Service
> >     matching "push_notification.rb"
> >       if exist then exec "/usr/local/monit-scripts/ruby-daemon.sh
> push_notification stop"
> >
> > This generates a syntax error:
> > Starting monit: /etc/monit.d/must_not_be_running:3: syntax error 'exist'
> >
> > Is what I'm trying to do possible?
> >
> > For reference, here's the content of
> /usr/local/monit-scripts/ruby-daemon.sh
> >
> > #!/bin/bash
> > echo "Asking $1 for $2"
> > cd /var/www && RAILS_ENV=production bundle exec rake daemon:$1:$2
> > cd - > nul
> >
> > Thanks,
> > Phil
> >
> > --
> > To unsubscribe:
> > https://lists.nongnu.org/mailman/listinfo/monit-general
>
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general
>
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to