init.d脚本模板

  Linux
#!/bin/bash
#
# chkconfig: 2345 10 90 
# description: 服务描述

### BEGIN INIT INFO
# Provides: blackboard
# Required-Start: network 
# Required-Stop:network 
# Short-Description: start and stop BlackBoard
# Description: 服务描述 
### END INIT INFO

start() {
    启动内容
}

stop() {
    停止内容
}

# See how we were called.
case "1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart|force-reload)
        stop
        start
        ;;
  *)
        echo"Usage: $0 {start|stop|restart|force-reload}"
        exit 2
esac