SYSTEMD under Supervisord service boot and Precautions

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.