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 set up supervisor to monitor some processes. Because I deploy via remote script, I need a way to send supervisor start/stop commands without sudo. I'm not sure how to do this though.

Is there a way in supervisor to run specified commands as a non root user?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

The supervisorctl command can be run as a non-root user. All you need to do is give it permission to connect to the supervisord process.

You'll need to configure access in the appropriate server section, so in the [unix_http_server] section, or in the [inet_http_server] section, whichever you are using for your supervisord setup.

If you use the [unix_http_server] setup, you'd add chmod and/or chown directives to control who can access the UNIX domain socket, for example:

[unix_http_server]
chown = youruser

so that youruser can write to that socket, which means supervisorctl can send supervisord commands. You can also add a group:

[unix_http_server]
chown = youruser:yourgroup
share|improve this answer
    
Thanks, also I tried to define a process group but supervisor isn't seeing it, even after a restart of supervisord itself. Is there some config I'm missing other than a [group:x] with programs & priority defined? –  user1561108 Dec 1 '12 at 20:20
    
@user1561108: You mean you added a [group:groupname] section and after a restart you don't see that added? [group:] sections don't specify permissions to access it, only an easy way to address a whole group of programs (to restart them together, for example), so I am a little confused if this still applies to your original question. –  Martijn Pieters Dec 1 '12 at 21:08
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.