Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My monitrc looks like this :

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

and my 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 script is never called (test.txt is never created).

What am I missing here ?

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

Your Answer


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

Browse other questions tagged or ask your own question.