Supervisor: Run a command as a specific group

Created on 26 Sep 2017  路  5Comments  路  Source: Supervisor/supervisor

I want to run jupyterhub as the jupyterhub user. The jupyterhub user doesn't have permission to run Python. But it does have permission to run jupyterhub with the python group, which does have the correct permissions on the files.

In sudoers

jupyterhub ALL=(:python) NOPASSWD:/boot/tp/python/bin/jupyterhub

Without supervisord I can run the command as follows

$ whoami
jupyterhub
$ sudo -g python ./jupyterhub
question

Most helpful comment

If anyone else finds this the go supervisord implementation has added this feature.

You can specify the group on the user line for example user = $user:$group.

https://github.com/ochinchina/supervisord

All 5 comments

Please ask questions about using Supervisor on the supervisor-users mailing list. We use this issue tracker mainly for bugs in Supervisor itself.

Thanks. The certificate on that link is not valid in Chrome on Windows 10. It says the certificate is issues to bahia.palladion.com.

I did mean this as a bug report as I didn't think it was possible because I don't see a way to specific the group as you can specify the user.

http://supervisord.org/configuration.html#program-x-section-values

So it is possible to set the group?

FWIW by group I meant the Linux group.

When you set the user for a program, it will set the group to be the user's group as specified in /etc/passwd.

https://github.com/Supervisor/supervisor/blob/1f916d5c174654912a94f035d9baa922aa148110/supervisor/datatypes.py#L320-L322

I would like to specify the group to run the command as instead.

A new program value group would be added. Here are the other existing values. http://supervisord.org/configuration.html#program-x-section-values

If group is confusing with supervisord groups then what about gid?

If anyone else finds this the go supervisord implementation has added this feature.

You can specify the group on the user line for example user = $user:$group.

https://github.com/ochinchina/supervisord

Was this page helpful?
0 / 5 - 0 ratings