大网数据广告活动
服务器运维问答

Error when adding supervisord to run via systemd

· 52CE 我爱测

I am trying to run supervisor from systemd and I am following this tutorial here . Upon creating this file /etc/systemd/system/supervisord.service with the following contents: [Unit] Description=Supervisor daemon Documentation=ht…

问题原文

原帖链接 · Newskooler · CC BY-SA 4.0

I am trying to run supervisor from systemd and I am following this tutorial here.

Upon creating this file /etc/systemd/system/supervisord.service with the following contents:

[Unit]
Description=Supervisor daemon
Documentation=http://supervisord.org
After=network.target

[Service]
ExecStart=/usr/local/bin/supervisord -n -c /etc/supervisor/supervisord.conf
ExecStop=/usr/local/bin/supervisorctl $OPTIONS shutdown
ExecReload=/usr/local/bin/supervisorctl $OPTIONS reload
KillMode=process
Restart=on-failure
RestartSec=42s

[Install]
WantedBy=multi-user.target
Alias=supervisord.service

When I run it I get the following error:

Mar 17 01:18:22 ubuntu-s-1vcpu-1gb-nyc3-01 systemd[1]: Started Supervisor daemon.
Mar 17 01:18:22 ubuntu-s-1vcpu-1gb-nyc3-01 systemd[8772]: supervisord.service: Failed to execute command: No such file or directory
Mar 17 01:18:22 ubuntu-s-1vcpu-1gb-nyc3-01 systemd[8772]: supervisord.service: Failed at step EXEC spawning /usr/local/bin/supervisord: No such file or directory
Mar 17 01:18:22 ubuntu-s-1vcpu-1gb-nyc3-01 systemd[1]: supervisord.service: Main process exited, code=exited, status=203/EXEC
Mar 17 01:18:22 ubuntu-s-1vcpu-1gb-nyc3-01 systemd[1]: supervisord.service: Failed with result 'exit-code'.
Mar 17 01:19:04 ubuntu-s-1vcpu-1gb-nyc3-01 systemd[1]: supervisord.service: Service hold-off time over, scheduling restart.
Mar 17 01:19:04 ubuntu-s-1vcpu-1gb-nyc3-01 systemd[1]: supervisord.service: Scheduled restart job, restart counter is at 1.
Mar 17 01:19:04 ubuntu-s-1vcpu-1gb-nyc3-01 systemd[1]: Stopped Supervisor daemon.

Clearly it says that there is no such directory, but is creating one actually the correct way to solve the problem?

The reason why I am unsure is because when looking at other (I guess) similar issues (example: here), they seem to fix it differently. Also in the tutorial, it does not mention this path (the one that does not exist) anywhere else besides in the contents of supervisord.service, so I am quite confused what is happening here.

Can anyone please explain to me or point me to something specific to read in order to solve my problem in the correct way?

Thanks!

UPDATE

locate supervisord yields:

/etc/supervisor/supervisord.conf
/etc/systemd/system/supervisord.service
/usr/bin/echo_supervisord_conf
/usr/bin/supervisord
/usr/lib/python2.7/dist-packages/supervisor/supervisord.py
/usr/lib/python2.7/dist-packages/supervisor/supervisord.pyc
/usr/lib/python2.7/dist-packages/supervisor/tests/test_supervisord.py
/usr/lib/python2.7/dist-packages/supervisor/tests/test_supervisord.pyc
/usr/share/man/man1/echo_supervisord_conf.1.gz
/usr/share/man/man1/supervisord.1.gz
/var/log/supervisor/supervisord.log

locate supervisorctl yields:

/usr/bin/supervisorctl
/usr/lib/python2.7/dist-packages/supervisor/supervisorctl.py
/usr/lib/python2.7/dist-packages/supervisor/supervisorctl.pyc
/usr/lib/python2.7/dist-packages/supervisor/tests/test_supervisorctl.py
/usr/lib/python2.7/dist-packages/supervisor/tests/test_supervisorctl.pyc
/usr/share/man/man1/supervisorctl.1.gz

已采纳解答

原帖链接 · Nasir Riley · CC BY-SA 4.0

Your service file is specifying the wrong locations for the binaries.

In the file, change

/usr/local/bin/supervisord

To

/usr/bin/supervisord

And

/usr/local/bin/supervisorctl 

To

/usr/bin/supervisorctl 

Next, run the command systemctl daemon-reload and then systemctl start supervisord.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-03-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。