免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1688 | 回复: 0
打印 上一主题 下一主题

如何让/etc/rc.d/init.d/killall脚本最后关闭network服务 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-02-08 13:32 |只看该作者 |倒序浏览
各位大侠:
   我有一个应用程序在系统关机时必须在network stop之前关闭,这个应用在关闭前得与别一台服务器通讯,但现在我的应用程序却总是在其之后关闭,造成服务器总是因为无法通讯而异常。如果我手动把/var/lock/subsys/network文件删除,然后再关机就很正常。请问
有什么办法在/etc/rc.d/init.d/killall脚本中不关闭network,这样让系统把它做成普通进程在关机的最后杀死。
系统/etc/rc.d/init.d/killall脚本如下:
#! /bin/bash

# Bring down all unneeded services that are still running (there shouldn't
# be any, so this is just a sanity check)

case "$1" in
   *start)
        ;;
   *)
        echo $"Usage: $0 {start}"
        exit 1
        ;;
esac


for i in /var/lock/subsys/* ; do
        # Check if the script is there.
        [ -f "$i" ] || continue

        # Get the subsystem name.
        subsys=${i#/var/lock/subsys/}

        # Networking could be needed for NFS root.
        [ $subsys = network ] && continue

        # Bring the subsystem down.
        if [ -f /etc/init.d/$subsys.init ]; then
                /etc/init.d/$subsys.init stop
        elif [ -f /etc/init.d/$subsys ]; then
                /etc/init.d/$subsys stop
        else
                rm -f "$i"
        fi
done
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP