服务启动脚本

编制脚本并给予执行权限,增加服务脚本
vi /usr/lib/systemd/system/my.service
----------------------------------------------

[Unit]
Description=this is my self start service
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
ExecStart=/bin/sh /home/hello.sh start
ExecReload=/bin/sh /home/hello.sh restart
ExecStop=/bin/sh /home/hello.sh stop
KillSignal=SIGQUIT
TimeoutStopSec=5
KillMode=process
PrivateTmp=true

[Install]
WantedBy=multi-user.target

posted @ 2019-08-07 10:25  BicycleBoy  阅读(1116)  评论(0编辑  收藏  举报