I have installed monit for many applications with the root user. One of the applications is started with a non-root user account.

Unfortunately, when I update my app, I also need to restart it. My update process uses the non-root user (I use capistrano to udpate my app)

Since Monit is checking this app and the update process is done with the non-root user. In order to restart the app, the non-root user kills the app and monit restarts it.

I would like to allow the non-root user to be allowed to only restart this specific app. This user shouldn't be aloud to run other monit related actions.

Is there a way to allow a user run a specific monit action, even if he is not the owner of the monitrc ?

  • 1
    If you want to allow a non-root user to execute privileged command, you can use sudoers file. – Khaled Jan 21 '13 at 8:19
  • Is their a way to achieve this using monit config instead ? – Raphael Jan 22 '13 at 9:59

Add an entry to /etc/sudoers...

%non-root-group ALL=NOPASSWD:/usr/bin/monit 


non-root-user ALL=NOPASSWD:/usr/bin/monit 


non-root-user ALL=NOPASSWD:/usr/bin/monit reload # to give a specific Monit command.
  • Is their a way to achieve this using monit config instead ? – Raphael Jan 22 '13 at 9:58
  • Finally granted my user this privilege, but I am still looking for a way to achieve this from a monit config point – Raphael Jan 27 '13 at 19:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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