.netcore centos配置systemctl自动启动

Posted ives

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了.netcore centos配置systemctl自动启动相关的知识,希望对你有一定的参考价值。

systemd分两种服务系统和用户服务

对应存储位路径为系统(/user/lib/systemd/system/)、用户(/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  

 

启动服务

systemctl start file.service

这里的fileservice为文件名

将会调用配置中的脚本

ExecStart:启动脚本

ExecReload:重启脚本

ExecStop:停止脚本

开机自启配置

systemctl enable file.service

 

以上是关于.netcore centos配置systemctl自动启动的主要内容,如果未能解决你的问题,请参考以下文章

Python 操作Redis

python爬虫入门----- 阿里巴巴供应商爬虫

Python词典设置默认值小技巧

《python学习手册(第4版)》pdf

Django settings.py 的media路径设置

Python中的赋值,浅拷贝和深拷贝的区别