您现在的位置是: 软件 > 操作系统专区 > Linux园地 > Linux安装配置 > 正文


-多媒体播放
-ASP入门到精通
-矢量图象设计三剑客
-Visual Basic精彩编程100例

Wrapper和xinetd的实现(三)
2003-04-29· ·赵凤君··天极软件频道

上一页  1 2 3 4 5 6  下一页

xinetd进程


1
启动与中止

如果你使用的是7.x 的默认安装

/etc/rc.d/init.d/xinetd start

/etc/rc.d/init.d/xinetd stop

/etc/rc.d/init.d/xinetd restart

/etc/rc.d/init.d/xinetd reload

或者

/sbin/service xinetd start

/sbin/service xinetd stop

/sbin/service xinetd restart

/sbin/service xinetd reload

 

如果你使用的是6.x上的自行编译安装

 

你需要自行建立xinetd启动脚本:

touch /var/run/xinetd.pid

touch /var/lock/subsys/xinetd

chmod 755 /etc/rc.d/init.d/xinetd

 

你可以用下面的命令来控制进程:

/etc/rc.d/init.d/xinetd start

/etc/rc.d/init.d/xinetd stop

/etc/rc.d/init.d/xinetd restart

/etc/rc.d/init.d/xinetd reload

 

vi /etc/rc.d/init.d/xinetd

##文件内容如下: 

/etc/rc.d/init.d/xinetd文件内容

#!/bin/bash

 

#

 

# xinetd        This starts and stops xinetd.

 

#

 

# chkconfig: 345 56 50

 

# description: xinetd is a powerful replacement for inetd. \

 

#                                 xinetd has access control machanisms, extensive \

 

#              logging capabilities, the ability to make services \

 

#              available based on time, and can place \

 

#              limits on the number of servers that can be started, \

 

#              among other things.

 

#

 

# processname: /usr/sbin/xinetd

 

# config: /etc/sysconfig/network

 

# config: /etc/xinetd.conf

 

# pidfile: /var/run/xinetd.pid

 

prog="xinetd"

 

PATH=/sbin:/bin:/usr/bin:/usr/sbin

 

# Source function library.

 

. /etc/rc.d/init.d/functions

 

# Get config.

 

test -f /etc/sysconfig/network && . /etc/sysconfig/network

 

# Check that networking is up.

 

[ ${NETWORKING} = "yes" ] || exit 0

 

[ -f /usr/sbin/xinetd ] || exit 1

 

[ -f /etc/xinetd.conf ] || exit 1

 

RETVAL=0

 

start(){

 

    echo -n $"Starting $prog: "

 

    # Need to get rid of localization for external services -

 

    # it doesn't make much sense to have i18n on the server side here

 

    LANG=en_US

 

    LC_TIME=en_US

 

    LC_ALL=en_US

 

    LC_MESSAGES=en_US

 

    LC_NUMERIC=en_US

 

    LC_MONETARY=en_US

 

    LC_COLLATE=en_US

 

    export LANG LC_TIME LC_ALL LC_MESSAGES LC_NUMERIC LC_MONETARY LC_COLLATE

 

    unset HOME MAIL USER USERNAME

 

    daemon xinetd -stayalive -reuse -pidfile /var/run/xinetd.pid

 

    RETVAL=$?

 

    echo

 

    touch /var/lock/subsys/xinetd

 

    return $RETVAL

 

}

 

stop(){

 

    echo -n $"Stopping $prog: "

 

    killproc xinetd

 

    RETVAL=$?

 

    echo

 

    rm -f /var/lock/subsys/xinetd

 

    return $RETVAL

 

}

 

reload(){

 

    echo -n $"Reloading configuration: "

 

    killproc xinetd -USR2

 

    RETVAL=$?

 

    echo

 

    return $RETVAL

 

}

 

restart(){

 

    stop

 

    start

 

}

 

condrestart(){

 

    [ -e /var/lock/subsys/xinetd ] && restart

 

    return 0

 

}

 

# See how we were called.

 

case "$1" in

 

    start)

                            start

                            ;;

 

    stop)

                            stop

                            ;;

 

    status)

                            status xinetd

                            ;;

 

    restart)

                            restart

                            ;;

 

    reload)

                            reload

                            ;;

    condrestart)

 

                            condrestart

                            ;;

    *)

 

                            echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"

 

                            RETVAL=1

 

esac

 

exit $RETVAL

上一页  1 2 3 4 5 6  下一页

【责任编辑:mage】
【发表评论】【关闭窗口】
■ 相关内容
 Wrapper和xinetd的实现(二)
 Wrapper和xinetd的实现(一)
感谢 访问天极网,如果您觉得该文章涉及版权问题,请看这里!