CentOS7利用systemctl添加dotnet后台服务

/usr/lib/systemd/system/zl.service

systemctl enable zl.service

systemctl start zl.service

[Unit]
Description=zl System Service
After=network.target

[Service]
WorkingDirectory=/home/ZL
Type=simple
User=root
Group=root
ExecStart=/usr/bin/dotnet /home/ZL/JieYun.Web.dll
Restart=always
RestartSec=10
SyslogIdentifier=dotnet-zl
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false

[Install]
WantedBy=multi-user.target

原文地址:https://www.cnblogs.com/YrRoom/p/11761980.html