ochinchina / supervisord

a go-lang supervisor implementation
MIT License
4.03k stars 568 forks source link

使用 systemd 启动 supervisord进程,报:Err=Unable to run open /dev/stdout: no such device or address #202

Closed yswang0927 closed 4 years ago

yswang0927 commented 4 years ago

作者好, 我为 supervisord 写了一个 supervisord.service,然后使用 systemctl 进行管理,当我使用 systemctl start supervisord 启动它,启动失败,报如下错误:

supervisord[21823]: level=fatal msg="Unable to run" err="open /dev/stdout: no such device or address"

下面是相关的文件内容: supervisord.service

[Unit]
Description=Supervisord daemon

[Service]
Type=notify
ExecStart=/usr/bin/supervisord -d -c /etc/supervisor.conf
ExecStop=/usr/bin/supervisord ctl shutdown
ExecReload=/usr/bin/supervisord ctl reload
KillMode=process
Restart=on-failure
TimeoutStartSec=0
RestartSec=5s

[Install]
WantedBy=multi-user.target

/etc/supervisor.conf

[unix_http_server]
file=/var/run/supervisord.sock

[supervisord]
logfile=/var/run/supervisord.log
logfile_maxbytes=50MB
logfile_backups=10
loglevel=info
pidfile=/var/run/supervisord.pid
nodaemon=false
minfds=1024
minprocs=2000

[rpcinterface:supervisor]
supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisord.sock

[program:nginx_server]
command=/usr/local/nginx/sbin/nginx -g "daemon off;" -c /etc/nginx.conf
autostart=true
autorestart=true
startretries=3
startsecs=1
uesr=root
redirect_stderr=true
stdout_logfile=/var/run/log/supervisord_ngx.log
stdout_logfile_maxbytes=20MB
stdout_logfile_backups=2
stopasgroup=true
killasgroup=true

这个问题怎么解决啊? 网上搜了也没有找到可行的解决方法。

yswang0927 commented 4 years ago

我用的是 0.6.3 版本。

ochinchina commented 4 years ago

I have fixed similar issue, could you please try v0.6.7 version?

ochinchina commented 4 years ago

@Npip I have tested your issue in the latest supervisor, there is no such issue, it works. Please use the latest supervisor.