Public bug reported: 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 ** Affects: openvpn (Ubuntu) Importance: Undecided Status: New ** Tags: amd64 apport-bug trusty -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to openvpn in Ubuntu. https://bugs.launchpad.net/bugs/1274254 Title: Stopping openvpn is unreliable (Ubuntu specific behaviour) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openvpn/+bug/1274254/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs