monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Upgraded from 5.4 to 5.10 and everything started to break


From: Roman Kournjaev
Subject: Re: Upgraded from 5.4 to 5.10 and everything started to break
Date: Wed, 12 Nov 2014 17:02:14 +0200

Well it took a while,

Also the my initial script and the script Russell suggested worked only after adding /usr/bin/sudo when executing it.

So the command was :  stop program = "/usr/bin/sudo /etc/init.d/stop-main.sh"

Pretty confusing, but it works at last.

Thanks,
Roman


On Wed, Nov 12, 2014 at 3:24 PM, Martin Pala <address@hidden> wrote:
Hi,

you use nested quotes with no escaping, so the command is not valid. If you need more complicated script, it's better to move it to standalone script as Russell suggested in previous response.

Regards,
Martin



On 12 Nov 2014, at 13:18, Roman Kournjaev <address@hidden> wrote:



Hi 
I have upgraded to monit 5.10 yesterday and most of my startup scripts that monit was monitoring stopped working. 

Thats an example script .

So I started to patch things :

check process main_loop
matching "python poll.py"
   start program = "/bin/bash -c 'cd /opt/wondermall-scrapers/code; /usr/bin/python poll.py &'" with timeout 60 seconds
   stop program = "/bin/bash -c 'kill $(ps aux | grep "[p]ython poll.py" | awk "{print \$2}")'"
if uptime > 1 hours then restart


But the stop command also fails and I am getting the following mail back form monit : 


Monit alert main_loop at Tue, 11 Nov 2014 18:48:37 on full-scraper-dev-9d66.c.wondermall-dev.internal,

failed to stop (exit status 123) -- /bin/bash:
Usage:
 kill [options] <pid> [...]

Options:
 <pid> [...]            send signal to every <pid> listed
 -<signal>, -s, --signal <signal>
                        specify the <signal> to be sent
 -l, --list=[<signal>]  list all signal names, or

Dutifully,
Monit
-- 


Of course that works when executing in simple bash , someone know what I am doing wrong ?


Thanks

Roman

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general


reply via email to

[Prev in Thread] Current Thread [Next in Thread]