linux运行 netcore,linux 下netcore程序开机自动启动服务

[Unit]
Description=aixiezuo守护进程

[Service]
WorkingDirectory=/www/wwwroot/fuwu/linux-x64
ExecStart=/usr/bin/dotnet /www/wwwroot/fuwu/linux-x64/AIXieZuoNetCore.dll

# 程序崩溃后自动启动
Restart=always
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=aixiezuo.service
# 用户角色
User=root
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
# The default value is 90 seconds for most distributions.
TimeoutStopSec=90

[Install]
WantedBy=multi-user.target

 

 

 

------------服务 启动命令----

//启动服务

systemctl start  crazybuild.service

//设置服务为开机自启动

systemctl enable crazybuild.service

posted @ 2023-03-09 16:49  tofight  阅读(435)  评论(0编辑  收藏  举报