gpt4 book ai didi

php - 错误 : Can't drop privilege as nonroot user: container keeps restarting on Google Cloud Compute Engine

转载 作者:行者123 更新时间:2023-12-04 17:18:56 27 4
gpt4 key购买 nike

我已经搜索过,但似乎无法找到此错误的答案。创建新 VM 时出现“错误:无法删除非 root 用户权限”。
容器不断重启。它在我本地的 MacOS 机器上运行良好。
我正在尝试使用 Container Optimized OS 在 Google Compute Engine VM 上运行镜像。
我正在使用 nginx、php-fpm 和 alpine。
supervisord.conf 文件如下所示:

[supervisord]
nodaemon=true
logfile=/dev/null
logfile_maxbytes=0
pidfile=/run/supervisord.pid
user=root

[program:php-fpm]
command=php-fpm8 -F
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autostart=true
autorestart=true
priority=5
stdout_events_enabled=true
stderr_events_enabled=true

[program:nginx]
command=nginx -g 'daemon off;'
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=false
startretries=0
有人也遇到过这个错误吗?

最佳答案

看起来您正在尝试以非 root 用户身份启动 Supervisor。
您的配置文件告诉 Supervisor 以 root 身份运行,但如果您以非 root 用户身份启动它,则它无法以 root 权限启动进程。 It was changed在 3.3.4 版本中由于安全原因:

Fixed a bug where supervisord would continue starting up if the [supervisord] section of the config file specified user= but setuid() to that user failed. It will now exit immediately if it cannot drop privileges.


看看 this duscussion ;

You can remove user=root entirely, which will allow supervisord to start as root or non-root. When run as root, this has the side effect of printing a warning message to the log, since we recommend having a user= when run as root. Assuming the environment that supervisord is started in contains the variable USER and it is set to the current user, you should be able to use user=%(ENV_USER)s to run as either user.


另一个类似的问题是 discussed at Server Fault .

关于php - 错误 : Can't drop privilege as nonroot user: container keeps restarting on Google Cloud Compute Engine,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67344737/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com