- 论坛徽章:
- 0
|
以前整理的,参考一下吧
六. 制作自启动脚本
制作启动脚本命名为S97proftpd文件放到/etc/rc3.d/下
1,确保启动脚本写正确。不只是直接运行命令,还要看是不是需要设置相应的环境变量。
2,启动脚本的命名。必须以大写的S开头,后边根数字标志该目录下各个文件的执行顺序。再后边的字母随便起。
3,当系统进入运行级别3时会执行/etc/rc3.d目录下所有以大写S开头的脚本,相应的系统进入运行级别2时执行/etc/rc2.d目录下的以大写S开头的脚本。
S97proftpd内容:
#!/bin/sh
# description: ProFTPD is an enhanced FTP server with \
# a focus toward simplicity, security, and ease of configuration. \
# It features a very Apache-like configuration syntax, \
# and a highly customizable server infrastructure, \
# including support for multiple 'virtual' FTP servers, \
# anonymous FTP, and permission-based directory visibility.
# processname: proftpd
# config: /usr/local/etc/proftpd.conf
pid=`/usr/bin/ps -ef | /usr/bin/grep proftpd | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
case "$1" in
'start')
/usr/local/sbin/proftpd &
;;
'stop')
if [ "${pid}" != ""];
then
ps -ef|grep proftpd| grep -v grep|awk '{print "kill -9 " $2}'
fi
;;
*)
echo "usage: /usr/local/etc/proftpd.conf"
;;
esac
exit 0
+Proftpd为默认FTP服务器(Solaris 8 本身默认安装一个ftp)
默认ftp停用的方法:/etc/inet/inet.conf中ftp 服务mask掉 以后再重新启动inetd服务
proftpd.conf-> #DefaultServer on |
|