Try putting that logic in a single bash script. With the && you're running
two processes which creates two pids.

Thanks,

Russ
On Jun 9, 2015 8:13 AM, "Yuriy Zhilovets" <[email protected]> wrote:

> Hi,
>
> For every program I am trying to run Monit responds: failed to start.
> Program timed out.
> After a while it somehow notices that this program nevertheless runs and
> complains  about this sad fact.
> No difference if I check process by its PID file of with a "match"
> directive
>
> Monit 5.11 under Ubuntu 15.04
>
> ================================
> monit.conf:
>
> check process move-data matching "move-data.pl"
>   start program = "/bin/bash -c 'cd /var/opt/poller && ./move-data.pl'"
>   stop program = "/usr/bin/pkill -f move-data.pl"
> ==================================
>
> move-data.pl just enters an infinite loop and never returns. No forks,
> detaching from terminal or something of this kind
>
> ================================================
> $ monit -Ivv
>
> 'move-data' start: /bin/bash
> 'move-data' failed to start (exit status -1) -- Program /bin/bash timed out
>
> -------------------------------------------------------------------------------
>     monit() [0x41cf7b]
>     monit(LogError+0xb6) [0x41d906]
>     monit(Event_post+0x291) [0x4197c1]
>     monit() [0x417fc4]
>     monit(control_service+0x137) [0x418897]
>     monit() [0x42b6bd]
>     monit(validate+0x78) [0x42cc88]
>     monit(main+0x482) [0x40c4a2]
>     /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)
> [0x7effdf088a40]
>     monit() [0x40c771]
>
> -------------------------------------------------------------------------------
> 'move-data' monitoring enabled
> 'move-data' start action done
> 'move-data' check skipped -- service already handled in a dependency chain
> 'move-data' process is running with pid 14570
> 'move-data' process is running after previous exec error (slow starting or
> manually recovered?)
> 'move-data' zombie check succeeded [status_flag=0000]
> 'move-data' process is running with pid 14570
> ====================================================
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general
>
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to