问题:couldn't setuid to 502: Can't drop privilege as nonroot user

supervisor 3.3.2 版本遇到的此问题

错误日志

supervisor: couldn't setuid to 502: Can't drop privilege as nonroot user
supervisor: child process was not spawned
supervisor: couldn't setuid to 502: Can't drop privilege as nonroot user
supervisor: child process was not spawned
supervisor: couldn't setuid to 502: Can't drop privilege as nonroot user

解决方法

查看每个任务的配置文件的user配置项是否为运行supervisor服务用户。
比如:
我当前使用A用户登录系统并启动supervisor服务

supervisord -c etc/supervisord.conf

每个任务程序的运行用户设置成了B。

cat files/old.ini
...
user=B
...

当supervisor服务启动时就会出现上面的错误。
然后将 任务程序的运行用户设置成A,就不会出错正常运行。

cat files/old.ini
...
user=A
...

supervisor 3.3.4 版本遇到的此问题解决方法

将supervisor 主配置文件个别配置项更改为下(更改root用户为当前用户,因为非root用户无法切换到root用户。)

[supervisord]
user=当前用户 ;如果supervisord启动的环境包含变量USER并且它设置为当前用户,您应该能够以user=%(ENV_USER)s任一用户身份运行。

连接:https://github.com/Supervisor/supervisor/issues/1218

你可能感兴趣的:(问题:couldn't setuid to 502: Can't drop privilege as nonroot user)