Stopping openvpn is unreliable (Ubuntu specific behaviour)

Bug #1274254 reported by Simon Déziel on 2014-01-29
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openvpn (Ubuntu)

Bug Description

In certain conditions, stopping OpenVPN doesn't work and the pid removed while the process is left behind. I noticed this when trying to stop a newly started connection that fails to establish and keeps dialling.

This problem is Ubuntu specific as in Ubuntu, the init script does this:

 stop_vpn () {
   kill `cat $PIDFILE` || true
   rm -f $PIDFILE
   [ "$OMIT_SENDSIGS" -ne 1 ] || rm -f /run/sendsigs.omit.d/openvpn.$
   rm -f /var/run/openvpn.$NAME.status 2> /dev/null
   log_end_msg 0

While in Debian it uses start-stop-daemon that eventually sends a KILL signal to the unresponsive openvpn pid:

 stop_vpn () {
   start-stop-daemon --stop --quiet --oknodo \
       --pidfile $PIDFILE --exec $DAEMON --retry 5
   if [ "$?" -eq 0 ]; then
     rm -f $PIDFILE
     [ "$OMIT_SENDSIGS" -ne 1 ] || rm -f /run/sendsigs.omit.d/openvpn.$
     rm -f /run/openvpn/$NAME.status 2> /dev/null

Relevant version information:

$ lsb_release -rd
Description: Ubuntu Trusty Tahr (development branch)
$ apt-cache policy openvpn
  Installed: 2.3.2-7ubuntu2
  Candidate: 2.3.2-7ubuntu2
  Version table:
 *** 2.3.2-7ubuntu2 0
        500 trusty/main amd64 Packages
        100 /var/lib/dpkg/status
Release: 14.04

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: openvpn 2.3.2-7ubuntu2
ProcVersionSignature: Ubuntu 3.13.0-5.20-generic 3.13.0
Uname: Linux 3.13.0-5-generic x86_64
ApportVersion: 2.13.2-0ubuntu2
Architecture: amd64
CurrentDesktop: Unity
Date: Wed Jan 29 14:01:05 2014
InstallationDate: Installed on 2014-01-26 (2 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Alpha amd64 (20140124)
SourcePackage: openvpn
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.default.openvpn: [modified]
modified.conffile..etc.openvpn.update.resolv.conf: [modified]
mtime.conffile..etc.default.openvpn: 2014-01-26T19:20:41.158270
mtime.conffile..etc.openvpn.update.resolv.conf: 2012-05-13T16:22:01

Simon Déziel (sdeziel) wrote :
Simon Déziel (sdeziel) wrote :

I just noticed but the Ubuntu init script also introduced another Ubuntu specific bug (LP: #1261088).

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openvpn - 2.3.2-7ubuntu3

openvpn (2.3.2-7ubuntu3) trusty; urgency=medium

  [ Simon Deziel ]
  * Refresh delta with debian/openvpn.init.d:
   - Make stop action reliable by killing if needed
     (LP: #1274254, LP: #1200519)
   - Use new path for status file (LP: #1261088)
 -- Stephane Graber <email address hidden> Tue, 04 Feb 2014 09:31:39 -0500

Changed in openvpn (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers