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