zoukankan      html  css  js  c++  java
  • 系统级脚本 rpcbind

    [root@web02 ~]# vim  /etc/init.d/rpcbind 
    #! /bin/sh
    #
    # rpcbind       Start/Stop RPCbind
    #
    # chkconfig: 2345 13 87
    # description: The rpcbind utility is a server that converts RPC pr
    ogram 
    #              numbers into universal addresses. It must be running
     on the 
    #              host to be able to make RPC calls on a server on tha
    t machine.
    #
    # processname: rpcbind
    # probe: true
    # config: /etc/sysconfig/rpcbind
    
    
    # This is an interactive program, we need the current locale
    [ -f /etc/profile.d/lang.sh ] && . /etc/profile.d/lang.sh
    # We can't Japanese on normal console at boot time, so force LANG=C
    .
    if [ "$LANG" = "ja" -o "$LANG" = "ja_JP.eucJP" ]; then
        if [ "$TERM" = "linux" ] ; then
            LANG=C
        fi
    fi
    "/etc/init.d/rpcbind" 107L, 2073C                1,1           Top
    #! /bin/sh
    #
    # rpcbind       Start/Stop RPCbind
    #
    # chkconfig: 2345 13 87
    # description: The rpcbind utility is a server that converts RPC program 
    #              numbers into universal addresses. It must be running on the 
    #              host to be able to make RPC calls on a server on that machine.
    #
    # processname: rpcbind
    # probe: true
    # config: /etc/sysconfig/rpcbind
    
    
    # This is an interactive program, we need the current locale
    [ -f /etc/profile.d/lang.sh ] && . /etc/profile.d/lang.sh
    # We can't Japanese on normal console at boot time, so force LANG=C.
    if [ "$LANG" = "ja" -o "$LANG" = "ja_JP.eucJP" ]; then
        if [ "$TERM" = "linux" ] ; then
            LANG=C
        fi
    fi
    
    # Source function library.
    . /etc/init.d/functions
    
    # Source networking configuration.
    [ -f /etc/sysconfig/network ] &&  . /etc/sysconfig/network
    
    prog="rpcbind"
    [ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
    
    RETVAL=0
    uid=`id | cut -d( -f1 | cut -d= -f2`
    
    start() {
            # Check that networking is up.
            [ "$NETWORKING" = "yes" ] || exit 6
    
            [ -f /sbin/$prog ] || exit 5
    
            # Make sure the rpcbind is not already running.
            if status $prog > /dev/null ; then
                    exit 0
            fi
    
            # Only root can start the service
            [ $uid -ne 0 ] && exit 4
    
            echo -n $"Starting $prog: "
            daemon $prog $1 "$RPCBIND_ARGS"
            RETVAL=$?
            echo
            if [ $RETVAL -eq 0 ] ; then
                    touch /var/lock/subsys/$prog
                    [ ! -f /var/run/rpcbind.pid ] &&
                            /sbin/pidof $prog > /var/run/rpcbind.pid
            fi
            return $RETVAL
    }
    
    
    stop() {
            echo -n $"Stopping $prog: "
            killproc $prog
            RETVAL=$?
            echo
            [ $RETVAL -eq 0 ] && {
                    rm -f /var/lock/subsys/$prog
                    rm -f /var/run/rpcbind*
            }
            return $RETVAL
    }
    
    # See how we were called.
    case "$1" in
      start)
            start
            RETVAL=$?
            ;;
      stop)
            stop
            RETVAL=$?
            ;;
      status)
            status $prog
            RETVAL=$?
            ;;
      restart | reload| force-reload)
            stop
            start
            RETVAL=$?
            ;;
      condrestart | try-restart)
            if [ -f /var/lock/subsys/$prog ]; then
                    stop
                    start -w
                    RETVAL=$?
            fi
            ;;
      *)
            echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|try-restart}"
            RETVAL=2
            ;;
    esac
    
    exit $RETVAL
    

      

  • 相关阅读:
    Opencv算法运行时间
    markdown转换为html
    jQuery类名添加click方法
    box-sizing 盒子模型不改变大小
    nodejs 发送get 请求 获取博客园文章列表
    6、Python3中的常用正则表达式
    5、Python3打印函数名之__name__属性
    4、reduce函数工具的使用
    3、Python字符编码区分utf-8和utf-8-sig
    9、QT QLineEdit 密码模式
  • 原文地址:https://www.cnblogs.com/liweiming/p/9947626.html
Copyright © 2011-2022 走看看