/etc/rc.local is soft connection of /etc/rc.d/rc.local
applied to the process specified boot of
the boot does not take effect, you first need to check under /etc/rc.d/rc.local Can it be execute permissions
Write command process starts in the configuration file, specify the file you want to add process in the / lib / systemd / system /,
ex: supervisor
1.
echo "/usr/bin/supervisord -c /etc/supervisord.conf" >> /etc/rc.local
2.
vim /lib/systemd/system/supervisor.service
格式:
[Unit]
Description=supervisor
After=network.target
[Service]
Type=forking
# 进程启动停止重载的指令
ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf
ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown
ExecReload=/usr/bin/supervisorctl $OPTIONS reload
KillMode=process
Restart=on-failure
RestartSec=42s
[Install]
WantedBy=multi-user.target