Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 ?

share|improve this question
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 comment

1 Answer

up vote 1 down vote accepted

Add an entry to /etc/sudoers...

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

or

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

or

non-root-user ALL=NOPASSWD:/usr/bin/monit reload # to give a specific Monit command.
share|improve this answer
    
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
add comment

Your Answer

 
discard

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.