CentOS 增加服务

增加 ba.admin.service

cd /usr/lib/systemd/system/
vi ba.admin.service

文件内容如下:

[Unit]
Description=Bootstrap Admin Application

[Service]
Type=simple
WorkingDirectory=/usr/local/ba/admin
Environment=ASPNETCORE_ENVIRONMENT=Production
ExecStart=/usr/bin/dotnet Bootstrap.Admin.dll --urls http://localhost:50852
ExecStop=/bin/kill -2 $MAINPID
KillMode=process
Restart=on-failure
RestartSec=1s

[Install]
WantedBy=multi-user.target

增加 ba.client.service

cd /usr/lib/systemd/system/
vi ba.admin.service

文件内容如下:

[Unit]
Description=Bootstrap Client Application

[Service]
Type=simple
WorkingDirectory=/usr/local/ba/client
Environment=ASPNETCORE_ENVIRONMENT=Production
ExecStart=/usr/bin/dotnet Bootstrap.Client.dll --urls http://localhost:49185
ExecStop=/bin/kill -2 $MAINPID
KillMode=process
Restart=on-failure
RestartSec=1s

[Install]
WantedBy=multi-user.target
posted @ 2021-06-12 19:39  ArgoZhang  阅读(102)  评论(0编辑  收藏  举报