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

Created on 12 Nov 2013  路  4Comments  路  Source: Supervisor/supervisor

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).

Most helpful comment

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).

All 4 comments

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

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?

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).

Hello,

If we decide to start supervisor with a different account from root, is supervisor will be able to start processes with any account? Or we need to start supervisor as root in this case?

=> Already answered here: https://stackoverflow.com/questions/13905861/supervisor-as-non-root-user

Thanks.

Was this page helpful?
0 / 5 - 0 ratings