#!/bin/bash
function start()
{
# 启动命令
}
function stop()
{
# 停止命令
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage : start | stop | restart"
;;
esac
chmod a+x srvd
cp -arf srvd /etc/init.d/
systemctl start srvd
chkconfig --add srvd
chkconfig srvd on
原文地址:http://blog.51cto.com/12173069/2118590