LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 698|回复: 7

请教如何使vsftpd在开机时启动,用的源代码安装,谢谢先

[复制链接]
发表于 2004-6-21 17:18:14 | 显示全部楼层 |阅读模式
能不能把/etc/init.d/vsftpd帖出来,其他目录中的连接是什么名字啊
谢谢先
 楼主| 发表于 2004-6-21 17:21:01 | 显示全部楼层

自己先顶一个

求救阿
 楼主| 发表于 2004-6-21 17:33:19 | 显示全部楼层

自己在顶一个

斑竹有的话,帖一个啊
发表于 2004-6-21 17:52:17 | 显示全部楼层
root: ~/lqStock # cat /etc/rc.d/init.d/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
发表于 2004-6-21 17:52:44 | 显示全部楼层
不可以使用chkconfig将vsftpd加到启动,或是/etc/rc.local
 楼主| 发表于 2004-6-21 17:57:58 | 显示全部楼层

大大的感谢

谢了
 楼主| 发表于 2004-6-21 18:00:33 | 显示全部楼层

那在rc0之类的目录中连接的都是些什么名字啊

看起来都是k或s开头的
发表于 2004-6-21 18:03:01 | 显示全部楼层
root: /etc/rc0.d # cat K50vsftpd
#!/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
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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