.netcore centos configured to start automatically systemctl

systemd two types of service systems and customer service

Corresponding to the path for the system is stored bit ( / User / lib / systemd / System /), the user ( / etc / lib / systemd / User /)

 

[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  

 

Start Service

systemctl start file.service

fileservice here for file name

Configuration script will call

ExecStart: startup script

ExecReload: Restart script

ExecStop: Stop script

Boot from Kai Configuration

systemctl enable file.service

 

Guess you like

Origin www.cnblogs.com/ives/p/11359718.html