提供程序配置后,supervisord 拒绝启动

提供程序配置后,supervisord 拒绝启动

我正在设置supervisord来永久运行一些脚本。

如果我启动supervisord而不使用任何程序(/etc/supervisor/conf.d 中的*.conf 文件),它可以完美运行。

root@networking:~# systemctl restart supervisor
root@networking:~# supervisorctl
supervisor>

配置文件如下:

; supervisor config file

[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0700                       ; sockef file mode (default 0700)

[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor            ; ('AUTO' child log dir, default $TEMP)

; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[inet_http_server]
port=*:9001
username=foo
password=bar

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a unix socket

; The [include] section can just contain the "files" setting.  This
; setting can list multiple files (separated by whitespace or
; newlines).  It can also contain wildcards.  The filenames are
; interpreted as relative to this file.  Included files *cannot*
; include files themselves.

[include]
files = /etc/supervisor/conf.d/*.conf

我还看到如下的 Web UI 屏幕:

在此处输入图片描述

日志文件显示:

2022-03-25 22:21:47,391 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
2022-03-25 22:21:47,391 WARN No file matches via include "/etc/supervisor/conf.d/*.conf"
2022-03-25 22:21:47,399 INFO RPC interface 'supervisor' initialized
2022-03-25 22:21:47,400 INFO RPC interface 'supervisor' initialized
2022-03-25 22:21:47,400 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2022-03-25 22:21:47,400 INFO supervisord started with pid 39887

但是,如果我将程序文件添加到/etc/supervisor/conf.d/ez_send_email.conf

[program:ez_send_email]
command=php /var/www/html/ez/index.php worker process_email_queue
user=root
autostart=true
autorestart=true
startsecs=5
stdout_logfile=/var/log/supervisord/ez_send_email_output.log
stdout_logfile_maxbytes=10MB
stderr_logfile=/var/log/supervisord/ez_send_email_error.log
stderr_logfile_maxbytes=10MB

运行时我得到以下输出主管控制

root@networking:~# systemctl restart supervisor
root@networking:~# supervisorctl
unix:///var/run/supervisor.sock no such file
supervisor>

此外,Web UI 显示:

在此处输入图片描述

日志文件中也没有任何内容。我还尝试更改用户=root对于非 root 用户,但它也不起作用。

手动运行命令

php /var/www/html/ez/index.php worker process_email_queue

也运行良好。因此该命令似乎没有任何问题。

任何帮助将非常感激。

相关内容