0
点赞
收藏
分享

微信扫一扫

Linux守护进程

一葉_code 2022-03-31 阅读 132
linux

Linux的Daemon管理路径:
cd /etc/systemd/system

新建一个service配置文件:
vi my-auth.service

vi编辑器中编写的配置信息:
[Unit]

Description=Auth .NET Web API App running on Ubuntu

[Service]

WorkingDirectory=/home/auth

ExecStart=/usr/bin/dotnet /home/auth/AuthServer.Host.dlll

Restart=always

# Restart service after 10 seconds if the dotnet service crashes:

RestartSec=10

SyslogIdentifier=my-auth

User=root

Environment=ASPNETCORE_ENVIRONMENT=Production

[Install]

WantedBy=multi-user.target

退出并保存vi
wq

刷新daemon让配置生效
systemctl deamon-reload

查看所有.net core进程
ps -ef|grep dotnet

查看服务状态
systemctl status my-auth

停止或重启服务
systemctl stop my-auth

systemctl restart my-auth

举报

相关推荐

0 条评论