Chinaunix首页 | 论坛 | 博客
  • 博客访问: 137279
  • 博文数量: 35
  • 博客积分: 2000
  • 博客等级: 大尉
  • 技术积分: 380
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-09 12:22
个人简介

http://www.76ku.cn

文章分类

全部博文(35)

文章存档

2011年(1)

2010年(17)

2007年(17)

我的朋友

分类: LINUX

2010-04-14 15:22:54

1.将下面的文件保存为  /etc/init.d/proftpd

2.添加可执行权限
  chmod +x /etc/init.d/proftpd

3.添加到系统服务
  chkconfig --add proftpd
  chkconfig proftpd on

4.手动起动、停止、重启
  service proftpd start
  service proftpd stop
  service proftpd restart

============ proftpd 的内容 ================
#!/bin/sh
# chkconfig: 345 85 15
# description: proftpd is a ftp daemon
# ProFTPD files
FTPD_BIN=/opt/proftp/sbin/proftpd
FTPD_CONF=/opt/proftp/etc/proftpd.conf
PIDFILE=/opt/proftp/var/proftpd/proftpd.pid
# If PIDFILE exists, does it point to a proftpd process?
if [ -f $PIDFILE ]; then
pid=`cat $PIDFILE`
fi
if [ ! -x $FTPD_BIN ]; then
echo "$0: $FTPD_BIN: cannot execute"
exit 1
fi
case $1 in
start)
if [ -n "$pid" ]; then
echo "$0: proftpd [PID $pid] already running"
exit
fi
if [ -r $FTPD_CONF ]; then
echo "Starting proftpd..."
$FTPD_BIN -c $FTPD_CONF
else
echo "$0: cannot start proftpd -- $FTPD_CONF missing"
fi
;;
stop)
if [ -n "$pid" ]; then
echo "Stopping proftpd..."
kill -TERM $pid
else
echo "$0: proftpd not running"
exit 1
fi
;;
restart)
if [ -n "$pid" ]; then
echo "Rehashing proftpd configuration"
kill -HUP $pid
else
echo "$0: proftpd not running"
exit 1
fi
;;
*)
echo "usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit 0
===========================================


阅读(938) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~