Mar302014
centos xl2tpd安装包启动脚本
已经安装好了L2TP服务器,不过当我们 service xL2TPd restart 的时候发现并不能启动。其实只是没有启动脚本而已,自己添加一个即可。
先
vim /etc/init.d/xl2tpd
#!/bin/sh # # xl2tpd This shell script takes care of starting and stopping l2tpd. # # chkconfig: - 80 30 # de script ion: Layer 2 Tunnelling Protocol Daemon (RFC 2661) # # processname: xl2tpd # config: /etc/xl2tpd/xl2tpd.conf # pidfile: /var/run/xl2tpd.pid #Servicename SERVICE=xl2tpd # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network if [ ${NETWORKING} = "no" ] then exit 0 fi [ -x /usr/local/sbin/$SERVICE ] || exit 0 RETVAL=0 start() { echo -n "Starting $SERVICE: " if [ ! -d /var/run/xl2tpd ] then mkdir /var/run/xl2tpd fi daemon /usr/local/sbin/$SERVICE RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SERVICE echo "" return $RETVAL } stop() { echo -n "Stopping $SERVICE: " killproc $SERVICE RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$SERVICE return $RETVAL } restart() { stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) status $SERVICE RETVAL=$? ;; restart|reload) restart ;; condrestart) [ -f /var/lock/subsys/$SERVICE ] && restart || : ;; *) echo "Usage: $SERVICE {start|stop|status|restart|reload|condrestart}" exit 1 esac
然后
chmod +x /etc/init.d/xl2tpd
就可以了。
也可以再
chkconfig --add xl2tpd
添加到系统服务