Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Supervisor to guard dotnetcore program

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to use Supervisor to guard dotnetcore program". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to use Supervisor to guard dotnetcore program".

Environmental preparation

1. Set the nginx service to boot

Systemctl enable nginx.servic

two。 Install Supervisor

Yum install python-setuptoolseasy_install supervisor

3. Configure Supervisor

Mkdir / etc/supervisorecho_supervisord_conf > / etc/supervisor/supervisord.conf# specifies the profile supervisord-c / etc/supervisor/supervisord.conf

Specify the program configuration of the daemon

Vim / etc/supervisor/supervisord.conf

Increase at the end

[include] files=conf.d/*.conf configuration Supervisor boot

Create a new "supervisord.service" file

# dservice for systemd (CentOS 7.0 +) # by ET-CS (https://github.com/ET-CS)[Unit]Description=Supervisor daemon [service] Type=forkingExecStart=/usr/bin/supervisord-c / etc/supervisor/supervisord.confExecStop=/usr/bin/supervisorctl shutdownExecReload=/usr/bin/supervisorctl reloadKillMode=processRestart=on-failureRestartSec=42s [Install] WantedBy=multi-user.target

Copy the file to "/ usr/lib/systemd/system/supervisord.service"

Execute command: systemctl enable supervisord

Configure the daemon

New configuration

Vim / etc/supervisor/conf.d/acore.dll.conf

[program:acore.dll] command=/bin/bash-c "dotnet acore.dll server.urls= http://127.0.0.1:3000/"directory=/root/dotnetcore/acore/autorestart=falsestderr_logfile=/var/log/acore.dll.err.logstdout_logfile=/var/log/acore.dll.out.logenvironment=ASPNETCORE_ENVIRONMENT=Developmentuser=rootstopsignal=INT

Reload configuration

Supervisorctl reloadsupervisorctl start acore.dll

Check to see if it is pulled up by the daemon

Restart the computer to see if it starts automatically

Thank you for reading, the above is the content of "how to use Supervisor to guard dotnetcore program". After the study of this article, I believe you have a deeper understanding of how to use Supervisor to guard dotnetcore program, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report