I have Openvpn server with multiple client. In the server configurations I use client-connect and client-disconnect script to notify external application on vpn server about connected/disconnected client.
client-connect /etc/openvpn/client_status.sh
client-disconnect /etc/openvpn/client_status.sh
the content of the client_status script is like this:
#!/bin/bash
cd `dirname $0` #switch to directory of client_status.sh
/usr/local/bin/node client_status --mode=$script_type --ip=$ifconfig_pool_remote_ip --name=$common_name
exit 0
which executes nodejs script (to serve some JSON apis). The problem started to appear when the script execution time became long (multiple seconds). During this multiple seconds all vpn routing is disabled!
What I did is to solve the porblem is to change script to fork the node process.
/usr/local/bin/node client_status --mode=$script_type --ip=$ifconfig_pool_remote_ip --name=$common_name &
(the ampersand at end of line).
Is this a bug in openvpn? I can't find any part in documentation which talk about this.
I am using OpenVPN 2.2.1 on ubuntu 12.04 64bit.