在主管程序中定义root用户无法正常工作?

时间:2019-06-22 13:11:29

标签: python ubuntu environment-variables supervisor

我定义了一个主管程序并在其中定义了root用户,如下所示

[program:feeds]
directory=/path/to/project/
environment=PATH="/root/.pyenv/versions/myversion/bin/"
environment=PYTHONIOENCODING="UTF-8"
environment=LC_ALL=C.UTF-8
environment=LC_CTYPE=C.UTF-8
environment=C_FORCE_ROOT="true"
command=sudo /root/.pyenv/versions/myversion/bin/python manage.py mycommand 
stdout_logfile=/project/logs/mylog.log
stderr_logfile=/project/logs/mylog.log
autostart=true
autorestart=true
startsecs=10
stopwaitsecs=600
user=root

尽管我在程序中使用了environment=C_FORCE_ROOT="true",但仍然在日志中显示如下错误

Running a worker with superuser privileges when the
worker accepts messages serialized with pickle is a very bad idea!

If you really want to continue then you have to set the C_FORCE_ROOT
environment variable (but please think about this before you do).

User information: uid=0 euid=0 gid=0 egid=0

我如何以root用户身份运行此程序而不会出现错误?

0 个答案:

没有答案