check process tomcat with pidfile /var/run/tomcat.pid
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
(source)
i have found a answer.. i could do a: start_program = "su -c 'command here' USERiWANTtoUSE".. :)
You can do this to run as another user a specific command
This will run that command
" "
as the user you definedWhat 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.