systemctl管理自定义服务模版

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

 

  

[Unit]
Description=radius Release

[Service]
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:默认

posted @ 2021-08-17 15:49  伊铭(netease)  阅读(112)  评论(0编辑  收藏  举报