initng/daemon/openvpn.i
glen
cvs at pld-linux.org
Mon Dec 19 10:24:23 CET 2005
Author: glen
Date: Mon Dec 19 10:24:22 2005
New Revision: 6670
Modified:
initng/daemon/openvpn.i
Log:
- use rc-scripts to get lockfiles in place,
besides initng itself fails to mark this service UP correctly (stays in STARTING with 0.4.7)
Modified: initng/daemon/openvpn.i
==============================================================================
--- initng/daemon/openvpn.i (original)
+++ initng/daemon/openvpn.i Mon Dec 19 10:24:22 2005
@@ -1,56 +1,10 @@
-daemon daemon/openvpn/* {
- need = system/initial system/checkroot system/rundir;
-# need resolv.conf
- exec daemon = /usr/sbin/openvpn;
- exec_args daemon = --config /etc/openvpn/$NAME.conf --writepid /var/run/openvpn/$NAME.pid --cd /etc/openvpn;
- pid_file = /var/run/openvpn/$NAME.pid;
-}
-
+# Autogenerated by ./migrate_rc.d-initng.i.sh on Mon Dec 19 11:19:27 EET 2005
service daemon/openvpn {
- need = system/initial system/checkroot;
+ need = system/initial system/mountfs system/rundir;
require_network;
-
- script start = {
- echo "Trying to load tun module if any ..."
- modprobe tun > /dev/null 2>&1
- if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then
- echo "Detected broken /dev/net/tun symlink, fixing..."
- rm -f /dev/net/tun
- ln -s /dev/misc/net/tun /dev/net/tun
- fi
-
- [ -f /etc/sysconfig/openvpn ] && . /etc/sysconfig/openvpn
- if [ -z "$TUNNELS" ]; then
- echo "No tunnels configured in /etc/sysconfig/openvpn"
- exit 6
- fi
-
- for VPN in $TUNNELS; do
- if [ -e /etc/openvpn/$VPN.conf ]; then
- echo "Starting openvpn for $VPN"
- /sbin/ngc -u daemon/openvpn/$VPN > /dev/null
- else
- echo "Config missing: /etc/openvpn/$VPN.conf."
- fi
- done
- exit 0
- }
-
- script stop = {
- [ -f /etc/sysconfig/openvpn ] && . /etc/sysconfig/openvpn
- if [ -z "$TUNNELS" ]; then
- echo "No tunnels configured in /etc/sysconfig/openvpn"
- exit 6
- fi
- for VPN in $TUNNELS; do
- if [ -e /etc/openvpn/$VPN.conf ]; then
- echo "Stopping openvpn for $VPN"
- /sbin/ngc -d daemon/openvpn/$VPN > /dev/null
- else
- echo "Config missing: /etc/openvpn/$VPN.conf."
- fi
- done
- exit 0
- }
+ exec start = /etc/rc.d/init.d/openvpn;
+ exec_args start = start;
+ exec stop = /etc/rc.d/init.d/openvpn;
+ exec_args stop = stop;
}
More information about the pld-cvs-commit
mailing list