Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 操作系统 > Linux > 自行编译的vsftpd加入service(收藏论坛老大的)
【标  题】:自行编译的vsftpd加入service(收藏论坛老大的)
【关键字】:vsftpd,service
【来  源】:http://www.cublog.cn/u/12502/showart.php?id=180897

自行编译的vsftpd加入service(收藏论坛老大的)

Your Ad Here
standalone方式

# vi /etc/init.d/vsftpd

CODE:
#!/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
                for i in `ls /etc/vsftpd/*.conf`; do
                        site=`basename $i .conf`
                        echo -n $"Starting $prog for $site: "
                        /usr/sbin/vsftpd $i &
                        RETVAL=$?
                        [ $RETVAL -eq 0 ] && {
                           touch /var/lock/subsys/$prog
                           success $"$prog $site"
                        }
                        echo
                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
然后
# chkconfig --add vsftpd
# chkconfig --level 345 vsftpd on
# service vsftpd start


xinetd方式

CODE:
vi /etc/xinetd.d/vsftpd

# default: off
# description: The vsftpd FTP server serves FTP connections. It uses \
# normal, unencrypted usernames and passwords for authentication.
service ftp
{
disable = no
socket_type = stream
wait = no
user = root
server = /path/to/vsftpd
nice = 10
}
etc/rc.d/init.d/xinetd restart
几个makefile的探究GNU工具的使用:【上一篇】
让HP DV1000系列媒体控制按键在linux下工作:【下一篇】
【相关文章】
  • vsftpd.conf设置部分
  • /etc/services文件的阅读
  • Reporting Services Data Driven Subscriptions 基于数据驱动的订阅服务
  • Introduction to Microsoft Windows Services for UNIX 3.5
  • 微软Windows Service For Unix (SFU) 3.5的安装和使用
  • 用Delphi编写Web Service(实例)(续,用Delphi编写客户端)
  • XFire:轻松简单地开发Web Services
  • 用Delphi编写Web Service(实例)
  • VSFTPD 的配置方法
  • 编程获取当前Windows平台的System Service列表
  • 【随机文章】
  • freebsd下mrtg安装和配置全过程
  • Tip:使用Extender的ResolveControlID事件
  • 压缩ASP.NET中的ViewState
  • 让 Flash 支持 Wma
  • x86 CPU PC/104总线挂载数据采集卡寄存器操作实验
  • JBoss的配置
  • 解除网吧限制
  • ORA-00942: table or view does not exist
  • 有关uid问题的一些看法
  • 上传源码!(转载)
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.