systemctl管理自定义服务模版

一  日常工作中,有许多需要使用systemctl进行管理服务的时候

  

[Unit]
Description=radius Release

[Service]
Type=forking
ExecStart=/etc/init.d/radius start
ExecStop=/etc/init.d/radius stop
Restart=on-abnormal
RestartSec=5


[Install]
WantedBy=default.target

  1 unit部分描述随便写直接写服务名称好了

  2 service部分解释

    type:fork

    Execstart: 程序的运行路径

    Execstop: 程序的停止方式

    Restart:重启方式

  3 install:默认

原文地址:https://www.cnblogs.com/wxm-pythoncoder/p/15152661.html