一佳一

记录像1+1一样简洁的代码

导航

.NET6 ubantu supervisor配置

Posted on 2024-07-05 16:31  一佳一  阅读(8)  评论(0编辑  收藏  举报

1.安装并设置开机启动

sudo apt-get install supervisor
sudo systemctl enable supervisor

2./etc/supervisor/conf.d/ 

增加要守护的进程,有几个加几个文件

[program:xxxweb]
command=dotnet xxxweb.dll
directory=/usr/xxxweb
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=1
stderr_logfile=/var/log/xxxweb.err.log
stdout_logfile=/var/log/xxxweb.out.log

3.启用配置

sudo supervisorctl shutdown

supervisord -c /etc/supervisor/supervisord.conf

sudo service supervisor stop

sudo service supervisor start

4.查看进程状态

supervisorctl status