Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this critical: CRIT Supervisor running as root? #308

Closed
guettli opened this issue Nov 12, 2013 · 4 comments
Closed

Is this critical: CRIT Supervisor running as root? #308

guettli opened this issue Nov 12, 2013 · 4 comments

Comments

@guettli
Copy link

guettli commented Nov 12, 2013

We want to run supervisord as root, since we want to use a different user per program. AFAIK you need to run as root, if you want a program to run as a different user.

2013-11-12 11:44:31,166 CRIT Supervisor running as root (no user in config file)

If supervisor was made for this use case, the above message should not be CRIT (my opinion).

@mnaberez
Copy link
Member

This is by design and will not be changed. We want it to be very clear when the daemon is running as root.

@ghost
Copy link

ghost commented Aug 31, 2016

The default /etc/supervisord.con in Debian (and then Ubuntu and derived distribution) make it run as root.

Maybe the log message should give a clue about what to do?

@mnaberez
Copy link
Member

mnaberez commented Aug 31, 2016

The default /etc/supervisord.con in Debian (and then Ubuntu and derived distribution) make it run as root.

Please report the issue to the maintainers of the package you are installing. The distribution packages are created by people who are not involved with the Supervisor project. Their config files were not created by us so we can't change them.

Maybe the log message should give a clue about what to do?

The message CRIT Supervisor running as root (no user in config file) is printed when supervisord is running as root and there's no user in the config file. To remove the message, change one of those things (start it as a non-root user instead, or put a user in the config file). The message is intended to alert users who may be unintentionally running it as root, since we recommend dropping privileges.

If you intend to run it as root, and you don't want to see the message, you can set user=root in any semi-modern version of Supervisor.

Example:

# supervisord --version
3.3.1

# whoami
root

# cat /path/to/supervisord.conf
[supervisord]
logfile = /tmp/supervisord.log
user = root

[program:cat]
command = /bin/cat

# supervisord -n -c /path/to/supervisord.conf 
2016-08-31 06:55:50,613 CRIT Set uid to user 0
2016-08-31 06:55:50,613 INFO Increased RLIMIT_NOFILE limit to 1024
2016-08-31 06:55:50,616 INFO supervisord started with pid 2099
2016-08-31 06:55:51,623 INFO spawned: 'cat' with pid 2102
2016-08-31 06:55:52,629 INFO success: cat entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Note that it is running as root and the CRIT Supervisor running as root (no user in config file) message is not printed. There is one other message, CRIT Set uid to user 0, but we intend to change that to INFO (#693).

@smutel

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants