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

Monit runs with root, but i don't want to start my processes as root.. like mysql, mongrel, apache..

share|improve this question
up vote 42 down vote accepted
 check process tomcat with pidfile /var/run/
       start program = "/etc/init.d/tomcat start" 
             as uid nobody and gid nobody
       stop program  = "/etc/init.d/tomcat stop"
             # You can also use id numbers instead and write:
             as uid 99 and with gid 99
       if failed port 8080 then restart


share|improve this answer

i have found a answer.. i could do a: start_program = "su -c 'command here' USERiWANTtoUSE".. :)

share|improve this answer
or can use a option 'as uid USERNAME and gid GROUPNAME'. For ex: start_program = "command" as uid USER and gid GROUPNAME – Guilherme Aug 5 '09 at 21:40
it's better if you edit your answers with this information. – shingara Apr 7 '10 at 13:05

What operating system / distro are you using? How did you install Monit? Most dsitros 'do the right thing' and make sure things don't start as root.

share|improve this answer
i'm using debian sarge.. i've installed with apt-get.. i don't think monit can be started as other user than root.. by the way it can?.. :) – Guilherme Aug 7 '09 at 15:18
monit can be run by any user with monit -c .monitrc – Jayen Aug 9 '12 at 1:37

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.