1.安装supervisor
root@ubuntu:/home/dxm# apt-get install supervisor
2.进入/etc/supervisor目录
3.最后include后面有配置文件的地址
4.进入/etc/supervisor/conf.d目录
5.创建dotnet.conf文件,vim dotnet.conf,拷贝下面内容保存
[program:mynetcore]
directory=/home/dxm/publish/output/output1
command=/usr/bin/dotnet /home/dxm/publish/output/output1/ConsoleApp2.dll
autostart=true
autorestart=true
stdout_logfile=/home/dxm/publish/output/output1/logs/out.log
stderr_logfile=/home/dxm/publish/output/output1/logs/err.log
6.运行supervisorctl reload,
7.运行ps -ef | grep ConsoleApp2.dll
常用命令
supervisorctl stop program_name停止某个进程
supervisorctl start program_name启动某个进程
supervisorctl restart program_name重启某个进程
supervisorctl stop all停止全部进程
supervisorctl reload载入最新的配置文件,停止原有进程并按新的配置启动、管理所有进程
supervisorctl update根据最新的配置文件,启动新配置或有改动的进程,配置没有改动的进程不会受影响而重启
来源:CSDN
作者:dxm809
链接:https://blog.csdn.net/dxm809/article/details/104225036