依睛(IT blog) 我回来了,PHP<-->C/C++ LINUX

笨鸟

统计

积分与排名

友情连接

最新评论

通用Linux启动服务SHELL

 

#!/bin/sh

# Source function library.
. /etc/rc.d/init.d/functions

# See how we were called.
case "$1" in
  start)
             echo -n "Starting XXXXX: "
             # daemon XXXXX
             /usr/sbin/XXXXX start          //启动服务程序的路径
             echo "                                           [  OK  ]"
             touch /var/lock/subsys/XXXXX
             ;;
  stop)
             echo -n "Shutting down XXXXX: "
             killproc XXXXX
             echo
             rm -f /var/lock/subsys/XXXXX
             rm -f /var/run/XXXXX.pid
             ;;
  status)
             status XXXXX
             ;;
  restart)
             $0 stop
             $0 start
             ;;
  reload)
             echo -n "Reloading XXXXX: "
             killproc XXXXX -HUP
             echo
             ;;
  *)
             echo "Usage: $0 {start|stop|restart|reload|status}"
             exit 1
esac
 
exit 0

注:XXXXX是服务名称。

posted on 2007-09-07 08:59 向左向右走 阅读(260) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。