Allow user other than root to restart supervisorctl process?

I have a supervisor who runs a program as user stavros and I would like to give the same user permission to restart it using supervisorctl. Unfortunately I can only do this with sudo, otherwise I get permission denied in the socket.py file. How can I give myself permission to restart supervisor processes?

+3


source to share


2 answers


Personally, I think it's a good idea to run supervisord as root, but if you want to do this by allowing other users to completely restart, here's how I would do it.

1 / Create a supervisor in your group who will have restart rights on superboot

2 / Put the relevant users in the group manager

3 / In the supervisor configuration, use the following lines in the [unix_http_server] section:



chmod=0770                 ; socket file mode (default 0700)
chown=root:supervisor      ; socket file uid:gid owner

      

This ensures that access to the access socket is available from the selected users.

4 / Add supervisor to your system's initialization mechanism in respawn mode (init, systemd, upstart, etc.). It depends on your system. Respawn mode means the process will automatically restart if it crashes or stops.

5 / From one of the selected users, you should be able to use supervisorctl to run commands, including a complete shutdown, which will result in a complete restart of the supervisor.

+1


source


You might want to try reloading your superviord

process with a user stavros

.



0


source







All Articles