diff options
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | debian/openvpn.if-down.d | 3 | ||||
-rw-r--r-- | debian/openvpn.if-up.d | 3 | ||||
-rw-r--r-- | debian/openvpn.init.d | 7 |
4 files changed, 17 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog index 17733bf..7dcf182 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +openvpn (2.3.2-9) unstable; urgency=medium + + * Create /run/openvpn in init script even if no VPN is + autostarted by it. (Closes: #741938) + * Fix systemd detection based on /run/systemd/system. + + -- Alberto Gonzalez Iniesta <agi@inittab.org> Mon, 17 Mar 2014 15:40:02 +0100 + openvpn (2.3.2-8) unstable; urgency=medium * Add support for systemd. (Closes: #700888) diff --git a/debian/openvpn.if-down.d b/debian/openvpn.if-down.d index 77cfb79..61b8476 100644 --- a/debian/openvpn.if-down.d +++ b/debian/openvpn.if-down.d @@ -3,6 +3,7 @@ OPENVPN=/usr/sbin/openvpn OPENVPN_INIT=/etc/init.d/openvpn SYSTEMCTL=/bin/systemctl +SYSTEMD=/run/systemd/system if [ ! -x $OPENVPN ]; then exit 0 @@ -11,7 +12,7 @@ fi if [ -n "$IF_OPENVPN" ]; then for vpn in $IF_OPENVPN; do ## check systemd present - if [ -x $SYSTEMCTL ]; then + if [ -d $SYSTEMD ]; then $SYSTEMCTL stop openvpn@$vpn else $OPENVPN_INIT stop $vpn diff --git a/debian/openvpn.if-up.d b/debian/openvpn.if-up.d index a6548a5..feb4d6b 100644 --- a/debian/openvpn.if-up.d +++ b/debian/openvpn.if-up.d @@ -3,6 +3,7 @@ OPENVPN=/usr/sbin/openvpn OPENVPN_INIT=/etc/init.d/openvpn SYSTEMCTL=/bin/systemctl +SYSTEMD=/run/systemd/system if [ ! -x $OPENVPN ]; then exit 0 @@ -11,7 +12,7 @@ fi if [ -n "$IF_OPENVPN" ]; then for vpn in $IF_OPENVPN; do ## check systemd present - if [ -x $SYSTEMCTL ]; then + if [ -d $SYSTEMD ]; then $SYSTEMCTL start openvpn@$vpn else $OPENVPN_INIT start $vpn diff --git a/debian/openvpn.init.d b/debian/openvpn.init.d index e465c85..8507ace 100644 --- a/debian/openvpn.init.d +++ b/debian/openvpn.init.d @@ -58,8 +58,6 @@ start_vpn () { STATUSARG="--status /run/openvpn/$NAME.status $STATUSREFRESH" fi - mkdir -p /run/openvpn - # tun using the "subnet" topology confuses the routing code that wrongly # emits ICMP redirects for client to client communications SAVED_DEFAULT_SEND_REDIRECTS=0 @@ -110,6 +108,11 @@ case "$1" in start) log_daemon_msg "Starting $DESC" + # first create /run directory so it's present even + # when no VPN are autostarted by this script, but later + # by systemd openvpn@.service + mkdir -p /run/openvpn + # autostart VPNs if test -z "$2" ; then # check if automatic startup is disabled by AUTOSTART=none |