没有在Ubuntu 20.04上自动启动的超级用户

问题描述

我安装了最新的superviosrd

pip install supervisord==4.2.1

然后我将supervisord init script复制到/etc/init.d/supervisord

scp /path/to/init_script.sh /etc/init.d/supervisord

sudo update-rc.d supervisord defaults

然后我运行:

sudo service supervisord start && sudo service supervisord status

得到:

● supervisord.service - LSB: Starts supervisord - see http://supervisord.org
    Loaded: loaded (/etc/init.d/supervisord; generated)
    Active: active (exited) since Sat 2020-08-29 13:03:57 UTC; 19min ago
      Docs: man:systemd-sysv-generator(8)
    Tasks: 0 (limit: 1074)
    Memory: 0B
    CGroup: /system.slice/supervisord.service

 Aug 29 13:03:57 vagrant systemd[1]: Starting LSB: Starts supervisord - see http://supervisord.org...
 Aug 29 13:03:57 vagrant systemd[1]: Started LSB: Starts supervisord - see http://supervisord.org.

然后我检查

supervisorctl

得到

unix:///tmp/supervisor.sock no such file
supervisor>

但是,如果我手动运行

supervisord

它将开始:

redis                            STARTING  
supervisor> 

关于如何使它在启动时自动运行的任何想法?为什么sudo service supervisord start无法启动?

解决方法

要回答我自己的问题,是因为我使用的init script具有以下特征:

NAME=supervisord
DAEMON=/usr/bin/$NAME  
SUPERVISORCTL=/usr/bin/supervisorctl

但是,/usr/local/bin/中安装了supervisord,所以我更改了路径,一切都正常了。