大家帮忙看看服务启动脚本哪儿出问题了
本帖最后由 fujiefujie 于 2011-2-28 21:09 编辑
复制代码
- bin/bash
- # chkconfig: 2345 99 60
- # description: start/stop the zebrad router daemon.
- . /etc/init.d/functions
-
- start() { echo -n "start the zebra router daemon..."
- /usr/local/sbin/zebra -d
- [ $? -eq 0 ] && echo "ok"
- }
-
- stop() { echo -n "stop the zebra router daemon..."
- kill -9 `pgrep zebra` &> /dev/null
- [ $? -eq 0 ] && echo "ok"
- }
-
- status() { ps -ef | grep "zebra -d" | grep -v grep >> /dev/null
- if [ $? -eq 0 ]
- then
- echo "service zebrad is runnig now."
- else
- echo "service zebrad is down."
- fi
- }
-
- case $1 in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart)
- stop
- start
- ;;
- status)
- status
- ;;
- *)
- echo "usage:$0:start|stop|status"
- esac
作者: fujiefujie 发布时间: 2011-02-28
本帖最后由 fujiefujie 于 2011-2-28 21:10 编辑
我在执行脚本时出现以下错误:
service zebrad stop 能终止进程,但没有ok信息。而且kill后的内容也显示在前台。
service zebrad restart 只能stop 不能start 。
大家说说到底脚本哪儿出错了???
我在执行脚本时出现以下错误:
service zebrad stop 能终止进程,但没有ok信息。而且kill后的内容也显示在前台。
service zebrad restart 只能stop 不能start 。
大家说说到底脚本哪儿出错了???
作者: fujiefujie 发布时间: 2011-02-28
作者: fujiefujie 发布时间: 2011-02-28