Package: openvpn
Version: 2.3.4-5+deb8u1
Severity: important
Tags: patch

Dear Maintainer,

   * What led up to the situation?
Restart of openvpn daemon failed, caused by "Address already in use"
See OpenVPN ticket #891


   * What exactly did you do (or not do) that was effective (or
     ineffective)?
Problem has to do with systemd. Daemon is stopped and started immediately, 
while openvpn was not finished with its shutdown.
The start fails because the management socket is still open.
The init script has protection for this problem, with sleep (old days) or 
start-stop-daemon in current init script.
But systemd stops and starts in aggressive mode. So it hits this open socket.


   * What was the outcome of this action?
As a work-around, I suppressed the systemd redirect by inserting the following:

--- openvpn     2017-05-17 22:05:22.209221894 +0200
+++ openvpn.new 2017-05-18 22:30:05.587801865 +0200
@@ -20,6 +20,9 @@
 # Modified for openvpn by Alberto Gonzalez Iniesta <a...@inittab.org>
 # Modified for restarting / starting / stopping single tunnels by Richard 
Mueller <muel...@teamix.net>
 
+# Let systemd not intercept this script
+# Needed for restart (openvpn#891) and other init script functionality
+_SYSTEMCTL_SKIP_REDIRECT=1
 . /lib/lsb/init-functions
 
 test $DEBIAN_SCRIPT_DEBUG && set -v -x


With this patch, the init script is not interupted by systemd.
Tested with:
 - reboot
 - systemctl restart openvpn
 - /etc/init.d/openvn restart
 - service openvpn restart



   * What outcome did you expect instead?
Restart should work.



-- System Information:
Debian Release: 8.8
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 3.16.0-4-686-pae (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages openvpn depends on:
ii  debconf [debconf-2.0]  1.5.56
ii  init-system-helpers    1.22
ii  initscripts            2.88dsf-59
ii  iproute2               3.16.0-2
ii  libc6                  2.19-18+deb8u9
ii  liblzo2-2              2.08-1.2
ii  libpam0g               1.1.8-3.1+deb8u2
ii  libpkcs11-helper1      1.11-2
ii  libssl1.0.0            1.0.1t-1+deb8u6

Versions of packages openvpn recommends:
ii  easy-rsa  2.2.2-1

Versions of packages openvpn suggests:
ii  openssl     1.0.1t-1+deb8u6
pn  resolvconf  <none>

-- Configuration Files:
/etc/default/openvpn changed [not included]

-- debconf information excluded

Reply via email to