I'm trying to install monit on an Ubuntu 12.04 server. I have it set up, and configured (i think), but i'm not sure what user it's supposed to run as.
My user on the server is called deploy, and my monitrc file looks like this:
$ ls -l /etc/monit/monitrc
-rwx------ 1 deploy deploy 10229 2015-07-30 12:38 /etc/monit/monitrc
ie, it's owned by the user i log into the server with. I've started the monit daemon, and i can see it running with ps and i can log into the web interface for it.
What i'm unsure about is how to give it priveleges to restart processes. For example, nginx: if i want to restart nginx myself i need to do
sudo /etc/init.d/nginx restart
Does this mean that monit needs to do sudo as well in order to restart it? Or, should i configure monit with its own user, and set that user up so that it can restart nginx (and any other services which monit needs to restart or access) without sudo?
thanks, Max