.netcore centos配置systemctl自動啓動

systemd分兩種服務系統和用戶服務api

對應存儲位路徑爲系統(/usr/lib/systemd/system)、用戶(/etc/systemd/user/)spa

 

[Unit]    
Description=api services    
After=network.target         
[Service]    
Type=forking    
ExecStart=/Service/API/RunDotNetServices.sh    
ExecReload=/Service/API/RunDotNetServices.sh     
ExecStop=/Service/API/RunDotNetServices.sh    
PrivateTmp=true    
[Install]    
WantedBy=multi-user.target  

 

啓動服務code

systemctl start file.serviceblog

這裏的fileservice爲文件名ip

將會調用配置中的腳本get

ExecStart:啓動腳本it

ExecReload:重啓腳本io

ExecStop:中止腳本class

開機自啓配置配置

systemctl enable file.service

相關文章
相關標籤/搜索