服务启动脚本
编制脚本并给予执行权限,增加服务脚本
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