[Bug 1193878] [NEW] Init script loses track of openvpn processes sometimes

Ryan C. Underwood nemesis at icequake.net
Sun Jun 23 17:21:25 UTC 2013

Public bug reported:

I have a short cron job to check the status of an openvpn tunnel every
so often and restart the link if it seems lost.

*/5 * * * * ping -c1 >/dev/null 2>&1 || PATH=$PATH:/sbin
/etc/init.d/openvpn restart >/dev/null 2>&1

Most of the time this works okay.  However, occasionally it goes haywire
in that the script does not think any OpenVPN process is running:

# /etc/init.d/openvpn stop
 * Stopping virtual private network daemon(s)...
 *   No VPN is running.

But actually thousands of derelict OpenVPN processes are running, consuming resources on the server and consuming much bandwidth:
# ps ax |grep openvpn | wc -l
# ps ax |grep openvpn | head
  303 ?        Ss     0:04 /usr/sbin/openvpn --writepid /var/run/openvpn.tun0-client.pid --daemon ovpn-tun0-client --status /var/run/openvpn.tun0-client.status 10 --cd /etc/openvpn --config /etc/openvpn/tun0-client.conf --script-security 2
  358 ?        Ss     0:03 /usr/sbin/openvpn --writepid /var/run/openvpn.tun0-client.pid --daemon ovpn-tun0-client --status /var/run/openvpn.tun0-client.status 10 --cd /etc/openvpn --config /etc/openvpn/tun0-client.conf --script-security 2
  410 ?        Ss     0:03 /usr/sbin/openvpn --writepid /var/run/openvpn.tun0-client.pid --daemon ovpn-tun0-client --status /var/run/openvpn.tun0-client.status 10 --cd /etc/openvpn --config /etc/openvpn/tun0-client.conf --script-security 2

These processes must be killed manually.

** Affects: openvpn (Ubuntu)
     Importance: Undecided
         Status: New

You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to openvpn in Ubuntu.

  Init script loses track of openvpn processes sometimes

To manage notifications about this bug go to:

More information about the Ubuntu-server-bugs mailing list