1

I'm setting up supervisord to run a few scripts perpetually.

If I start supervisord without any program (*.conf file in /etc/supervisor/conf.d), it runs perfectly fine

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

Configuration file below:

; 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

I also see the web UI screen as below:

enter image description here

Log file shows:

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

However, If I add a program file to /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

I get the following output on running supervisorctl

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

Also, the web UI shows:

enter image description here

There is nothing in the log file either. I also tried changing user=root to a non root user but it does not work either.

Running the command manually

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

also works fine. So there does not seem to be any problem with the command.

Any help would be really appreciated.

0

You must log in to answer this question.

Browse other questions tagged .