Stopping openvpn is unreliable (Ubuntu specific behaviour)

Bug #1274254 reported by Simon Déziel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openvpn (Ubuntu)
Fix Released
Undecided
Unassigned

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.$NAME.pid
   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.$NAME.pid
     rm -f /run/openvpn/$NAME.status 2> /dev/null
   fi
 }

Relevant version information:

$ lsb_release -rd
Description: Ubuntu Trusty Tahr (development branch)
$ apt-cache policy openvpn
openvpn:
  Installed: 2.3.2-7ubuntu2
  Candidate: 2.3.2-7ubuntu2
  Version table:
 *** 2.3.2-7ubuntu2 0
        500 http://archive.ubuntu.com/ubuntu/ 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

Revision history for this message
Simon Déziel (sdeziel) wrote :
Revision history for this message
Simon Déziel (sdeziel) wrote :

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

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.