通用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-02 06:04 黑虫 阅读(691) 评论(0)  编辑 收藏 引用 所属分类: Unix/Linux

只有注册用户登录后才能发表评论。
<2007年8月>
2930311234
567891011
12131415161718
19202122232425
2627282930311
2345678

导航

统计

常用链接

留言簿(4)

随笔分类(31)

随笔档案(31)

awmsky

搜索

最新评论

阅读排行榜

评论排行榜