SYSTEMD under Supervisord service boot from startup centos7 boot script:
#vim /lib/systemd/system/supervisord.service# supervisord service for sysstemd (CentOS 7.0+)# by ET-CS (https://github.com/ET-CS)[Unit]Description=Supervisor daemon[Service]ExecStart=/usr/bin/supervisordExecStop=/usr/bin/supervisorctl $OPTIONS shutdownExecReload=/usr/bin/supervisorctl $OPTIONS reloadKillMode=processRestart=on-failureRestartSec=42s[Install]WantedBy=multi-user.target
This self-startup script needs to modify the/etc/supervisord.conf configuration file:
???? #vim/etc/supervisrod.conf
???????? Nodaemon=false???? Change to True
Or: #vim/lib/systemd/system/supervisord.service
[Unit]Description=Process Monitoring and Control DaemonAfter=rc-local.service[Service]Type=forkingExecStart=/usr/bin/supervisord -c /etc/supervisord.confSysVStartPriority=99[Install]WantedBy=multi-user.target
No need to modify the/etc/supervisord.conf configuration file
Both self-starting scripts can be added to the Systemctl self-starting service
#systemctl Enable Supervisord.service
#systemctl Start/restart/stop Supervisor.service
SYSTEMD under Supervisor Service self-start service management variable service
But when SUPERVIOSR managed services have environment variables, there are problems (such as starting Elasticserch services, having java_home and limit.conf dependencies), for reasons:/etc/profile or/etc/security/ LIMIT.CONF the environment variables configured in these files are only valid for users logged on through Pam,
And SYSTEMD is not reading these configurations, so this causes the login to the terminal when viewing environment variables and manually start the application is all right, but Systemd does not start the application normally
Get can be resolved by adding an environment variable (not tested because the Supervisor service self-starting needs are not very strong):
[Service]
environment=pythonpath=/opt/mypypath:% (Env_pythonpath) s,path=/opt/mypath:% (Env_path) s
Reference: Https://github.com/Supervisor/initscripts
Ref: 53203991
Reference: https://www.cnblogs.com/mhc-fly/p/8512491.html
Reference: http://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-commands.html
SYSTEMD under Supervisord service boot and Precautions