summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Gonzalez Iniesta <agi@inittab.org>2014-03-17 18:17:01 +0100
committerAlberto Gonzalez Iniesta <agi@inittab.org>2014-03-17 18:17:01 +0100
commit263a36ccf900dabf288e3050e2226cc7be6f38cd (patch)
treee443c617f1fdd84c105a0cf795b5e34bebc73dce
parentd94d10b7a7ceb5367367886eaaf845de6ec8ecee (diff)
Fix systemd issues
-rw-r--r--debian/changelog8
-rw-r--r--debian/openvpn.if-down.d3
-rw-r--r--debian/openvpn.if-up.d3
-rw-r--r--debian/openvpn.init.d7
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