QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1377|回复: 2

谁有/etc/init.d/vsftpd的脚本文件?贴出来看

[复制链接]
发表于 2005-1-28 14:44:52 | 显示全部楼层 |阅读模式
我在hiweed-debian里用源代码安装了vsftpd软件,但是我发现hiweed-debian好像不能用xinetd.d方式启动服务,好像只能用init.d方式启动服务,我
在/etc/init.d/下有没发现vsftpd这个文件,所以我想请各位大侠发个vsftpd脚本文件给我,或者贴出来也可以。谢谢!!!
我的邮箱[email protected]
发表于 2005-1-31 19:51:37 | 显示全部楼层
[code:1]
/etc/init.d#cat vsftpd

#!/bin/bash
#
# vsftpd      This shell script takes care of starting and stopping
#             standalone vsftpd.
#
# chkconfig: - 60 50
# description: Vsftpd is a ftp daemon, which is the program \
#              that answers incoming ftp service requests.
# processname: vsftpd
# config: /etc/vsftpd/vsftpd.conf

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -x /usr/sbin/vsftpd ] || exit 0

RETVAL=0
prog="vsftpd"

start() {
        # Start daemons.

        if [ -d /etc/vsftpd ] ; then
                declare -a sites
                sites=(`ls /etc/vsftpd/*.conf`)
                site_count=${#sites[@]}
                index=0

                while [ "${index}" -lt "${site_count}" ] ; do
                        site=`basename ${sites[${index}]} .conf`
                        echo -n $"Starting $prog for $site: "
                                ( /usr/sbin/vsftpd ${sites[${index}]} &)
                                daemon true
                                RETVAL=$?
                        echo
                        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
                        let "index = index + 1"
                done
        else
                RETVAL=1
        fi
        return $RETVAL
}

stop() {
        # Stop daemons.
        echo -n $"Shutting down $prog: "
        killproc $prog
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
        return $RETVAL
}

# See how we were called.
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart|reload)
        stop
        start
        RETVAL=$?
        ;;
  condrestart)
        if [ -f /var/lock/subsys/$prog ]; then
            stop
            start
            RETVAL=$?
        fi
        ;;
  status)
        status $prog
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart|condrestart|status}"
        exit 1
esac

exit $RETVAL
/etc/init.d#
[/code:1]
回复

使用道具 举报

 楼主| 发表于 2005-2-24 11:22:10 | 显示全部楼层
谢谢大侠!!!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-6-5 19:56 , Processed in 0.098386 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表