search

Home  >  Q&A  >  body text

linux - Ubuntu重启后Supervisor的任务不会启动

最近在ubuntu上运行laravel开发的一个队列服务,使用Supervisor做进程监控。

Supervisor配置文件如下

[program:xxx-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /home/vagrant/code/XXX/artisan queue:work --sleep=3 --tries=3 --daemon
autostart=true
autorestart=true
user=root
numprocs=8
redirect_stderr=true
stdout_logfile=/var/log/xxx-worker.log

配置文件创建后,更新Supervisor的设置,并用以下命令来启动后队列进程可以正常运行。

sudo supervisorctl reread

sudo supervisorctl update

sudo supervisorctl start xxx-worker:*

现在问题是,当我重启了服务器后,这个队列不会执行了,必须再手动执行以下

sudo supervisorctl start xxx-worker:*

请问,怎么让开机可以自动运行Supervisor的配置任务呢?

大家讲道理大家讲道理2818 days ago744

reply all(2)I'll reply

  • 怪我咯

    怪我咯2017-04-17 14:45:05

    Where is the supervisor log

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 14:45:05

    Put the manually executed command in the /etc/re.local file, and Ubuntu will execute the script inside after booting
    Here is a detailed explanation: http://www.oschina.net/question/54100_10344

    reply
    0
  • Cancelreply