linux制作成后台服务,把dotnetcore 控制台app设置成linux后台服务
1,新建service文件vim
vim /etc/systemd/system/dotnetTest.serviceip
內容
[Unit]
Description=dotnet consoleit
[Service]io
WorkingDirectory=/home/useeinfo/publishconsole
ExecStart=/usr/bin/dotnet /home/useeinfo/publish/ConsoleApp3.dlltest
Restart=alwaysservice
SyslogIdentifier=dotnet core consoleim
User=roottop
Environment=ASPNETCORE_ENVIRONMENT=Productiondi
2,開啟服務
systemctl start?dotnetTest.service
查看狀態
systemctl status?dotnetTest.service
Loaded: loaded (/etc/systemd/system/dotnetTest.service; disabled; vendor pres
Active: active (running) since Mon 2019-03-04 14:10:55 CST; 20s ago
Main PID: 6893 (dotnet)
Tasks: 10 (limit: 4915)
Memory: 27.1M
CGroup: /system.slice/dotnetTest.service
└─6893 /usr/bin/dotnet /home/wht/DotNetCore/test/ConsoleApp1.dll
中止服務
systemctl stop dotnetTest.service
總結
以上是生活随笔為你收集整理的linux制作成后台服务,把dotnetcore 控制台app设置成linux后台服务的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: workerman 和 swoole哪个
- 下一篇: 子宫内膜炎能造成不孕不育吗