Rumah > Soal Jawab > teks badan
supervisor 是用 yum install supervisor
进行安装的,安装后发现如果服务器重启,需要手动运行 supervisord
后才能执行 supervisor 管理的服务。
在官网 Running supervisord automatically on startup 这篇文章中描述,因为我不是用 "distribution-packaged" 安装的,所以不会被自动添加进去(用 easy_install supervisor
安装不成功)
同时还提供了第三方脚本,但是不知道怎么用 https://github.com/Supervisor/initscripts
请问,如何让 supervisor 在 centos 7 系统重启后自动运行呢?
某草草2017-04-25 09:06:08
centos 7 diurus menggunakan systemctl, cuma jalankan kod berikut:
$ systemctl enable supervisord.service
# 运行结果
Created symlink from /etc/systemd/system/multi-user.target.wants/supervisord.service to /usr/lib/systemd/system/supervisord.service.
Jika masih tidak dapat dimulakan, anda boleh mengedit fail supervisord.service
dalam laluan di atas dan menggantikannya dengan centos-systemd-etcs daripada github:
# supervisord service for sysstemd (CentOS 7.0+)
# by ET-CS (https://github.com/ET-CS)
[Unit]
Description=Supervisor daemon
[Service]
Type=forking
ExecStart=/usr/bin/supervisord
ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown
ExecReload=/usr/bin/supervisorctl $OPTIONS reload
KillMode=process
Restart=on-failure
RestartSec=42s
[Install]
WantedBy=multi-user.target
巴扎黑2017-04-25 09:06:08
CentOS7 ialah systemd cuma pasang unit centos-systemd-etcs dari repo itu ke /etc (semak sendiri laluan tertentu).
Tetapi mengapa yum bukan versi pakej pengedaran?
仅有的幸福2017-04-25 09:06:08
Pemasangan yum adalah mendalam, disyorkan untuk menyahpasang dan menggantikan kaedah pemasangan