Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My monitrc looks like this :

check process java with pidfile /opt/release/RUNNING_PID
    start program = "/bin/su -c /opt/release/start.sh root"
    stop  program = "/bin/su -c /opt/release/stop.sh root"
    if failed host 127.0.0.1 port 80 type tcp then restart

and my stop.sh script simply looks like this :

echo "Test" > /opt/release/test.txt

When I do sudo monit start java it starts my process correctly, but when I do sudo monit stop java my stop.sh script is never called (test.txt is never created).

What am I missing here ?

share|improve this question
1  
Not a monit user, but what user is the stop.sh script being run as? Is it executable? Does the user has write access to /opt/release? –  user160910 Jun 21 '13 at 16:53
    
The stop.sh script has the same rights and is run as root, the same as the start.sh script which works perfectly. –  TrexXx Jun 22 '13 at 19:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.