脚本样例:
#!/bin/bash
#
# author: chenxuyi
# createtime: 2015/09/21
# description: example for init
#
# chkconfig: 2345 95 5
# processname: test
# 函数定义
start(){}
stop(){}
restart(){}
# 程序主体
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
restart
;;
*)
echo "Use method: start | stop | reload"
exit 1
esac
exit 2
上面所列出的都是自启动脚本必需要有的(对本人而言,实际情况并非如此)