How i configure monit to start a process with a specific user?
26,733
Solution 1
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
Solution 2
i have found a answer.. i could do a: start_program = "su -c 'command here' USERiWANTtoUSE".. :)
Related videos on Youtube
Author by
Guilherme
Updated on September 17, 2022Comments
-
Guilherme over 1 year
Monit runs with root, but i don't want to start my processes as root.. like mysql, mongrel, apache..
-
Guilherme almost 15 yearsor can use a option 'as uid USERNAME and gid GROUPNAME'. For ex: start_program = "command" as uid USER and gid GROUPNAME
-
Guilherme almost 15 yearsi'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?.. :)
-
shingara about 14 yearsit's better if you edit your answers with this information.
-
b3m2a1 almost 12 yearsmonit can be run by any user with
monit -c .monitrc