From d93161c696bf9799cd86fe73e2a2e74871fbbdb2 Mon Sep 17 00:00:00 2001 From: Paul Wouters Date: Mon, 9 Mar 2009 00:19:56 +0000 Subject: [PATCH] updated init file for https://bugzilla.redhat.com/show_bug.cgi?id=247100 --- xl2tpd.init | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 xl2tpd.init diff --git a/xl2tpd.init b/xl2tpd.init new file mode 100644 index 0000000..6b9e732 --- /dev/null +++ b/xl2tpd.init @@ -0,0 +1,94 @@ +#!/bin/sh +# +# xl2tpd This shell script takes care of starting and stopping l2tpd. +# +# chkconfig: - 80 30 +# description: Layer 2 Tunnelling Protocol Daemon (RFC 2661) +# +# processname: /usr/sbin/xl2tpd +# config: /etc/xl2tpd/xl2tpd.conf +# pidfile: /var/run/xl2tpd.pid + +### BEGIN INIT INFO +# Provides: xl2tpd +# Required-Start: $local_fs $network $syslog +# Required-Stop: $local_fs $network $syslog +# Default-Start: +# Short-Description: start|stop|status|restart|try-restart|reload|force-reload xl2tpd server +# Description: control xl2tpd server +### END INIT INFO + +#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/sbin/$SERVICE ] || exit 0 + +RETVAL=0 + +start() { + echo -n "Starting $SERVICE: " + if [ ! -d /var/run/xl2tpd ] + then + mkdir /var/run/xl2tpd + fi + daemon $SERVICE + RETVAL=$? + echo + if [ $RETVAL -eq 0 ];then + touch /var/lock/subsys/$SERVICE + else + exit 7; + fi + return 0; +} + +stop() { + echo -n "Stopping $SERVICE: " + killproc $SERVICE + RETVAL=$? + if [ $RETVAL -eq 0 ]; then + rm -f /var/run/xl2tpd/$SERVICE + rm -f /var/lock/subsys/$SERVICE + fi + echo + 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