forget it, I got it working based on the existance of the file itself

On 13 May 2011 14:18, Nick Upson <[email protected]> wrote:

> Hi,
>
> I'm trying to make the startup of a process depend upon the contents of a
> file but it doesn't seems to work.
> as the file doesn't exist the check should fail, so why does the process
> try and start? the same happens if the file
> exists but doesn't contain "PRIMARY"
>
> ### config file
> check process openvpn_server with pidfile "/var/run/openvpn_server.pid"
> start program = "/etc/init.d/openvpn_server start" with timeout 5 seconds
> stop  program = "/etc/init.d/openvpn_server stop"
> depends on primary
>
> check file primary with path /tmp/primary
>     if match "PRIMARY" then exec "/bin/echo ok >> /tmp/ptest.log"
>
> ### monit logfile
> [BST May 13 14:12:43] info     : Starting monit daemon with http interface
> at [*:2812]
> [BST May 13 14:12:43] info     : Starting monit HTTP server at [*:2812]
> [BST May 13 14:12:43] info     : monit HTTP server started
> [BST May 13 14:12:43] info     : 'sl_cs' Monit started
> [BST May 13 14:12:43] error    : 'primary' file doesn't exist
> [BST May 13 14:12:43] info     : 'primary' trying to restart
> [BST May 13 14:12:43] info     : 'openvpn_server' stop:
> /etc/init.d/openvpn_server
> [BST May 13 14:12:44] info     : 'openvpn_server' start:
> /etc/init.d/openvpn_server
>
>
> --
> Nick Upson (01799 533252)
>
>


-- 
Nick Upson (01799 533252)
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to