Openvpn server suspends routing during client-connect script
Posted: Wed Jul 09, 2014 11:30 am
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.
the content of the client_status script is like this:
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. (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.
Code: Select all
client-connect /etc/openvpn/client_status.sh
client-disconnect /etc/openvpn/client_status.sh
Code: Select all
#!/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
What I did is to solve the porblem is to change script to fork the node process.
Code: Select all
/usr/local/bin/node client_status --mode=$script_type --ip=$ifconfig_pool_remote_ip --name=$common_name &
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.