mpd pptp server 配置实例( 二 )


user1 fortest

#end of mpd.secret

#注意:杀死进程时不要使用-9强行结束,否则可能导致进程不能正常关闭设备,必须重新启动系统才能恢复;

#服务管理脚本;
#vi /usr/local/sbin/mpd.sh

#!/bin/sh
case "$1" in

start)
if [ -x /usr/local/sbin/mpd ]; then
/usr/local/sbin/mpd -b -d /usr/local/etc/mpd -f mpd.conf && echo "Mpd PPtP server started."
fi


stop)
killall mpd && echo "Mpd PPtP server stopped."

restart)
echo .
echo Restart Mpd PPtP server ......
$0 stop
sleep 10
$0 start

*)
echo "$0 start | stop | restart"


esac
#end of mpd.sh

chmod 700 /usr/local/sbin/mpd.sh
#设置开机自动执行
ln -s /usr/local/sbin/mpd.sh /usr/local/etc/rc.d/mpd.sh

#配置日志记录
touch /var/log/mpd.log
#vi /etc/syslog.conf
#添加如下,!mpd表示mpd这个进程;
!mpd
*.* /var/log/mpd.log
#vi /etc/newsyslog.conf
/var/log/mpd.log 644 5 100 * Z
#重新启动syslogd
killall -HUP syslogd

####################################
mpd.sh restart


另外,红袖曾经投诉过论坛吃空格的问题,我发现,可以用code这个功能解决,试试?

推荐阅读