n-m-openvpn shuts down VPN when openvpn soft-restarts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NetworkManager |
Fix Released
|
High
|
|||
OpenVPN |
New
|
Unknown
|
|||
network-manager-openvpn (Ubuntu) |
Triaged
|
Medium
|
Unassigned | ||
Bug Description
Binary package hint: network-
Using openvpn rc9-3ubuntu2 and network-
When openvpn sends itself a SIGUSR1, network-
nm-openvpn[5682]: [server] Inactivity timeout (--ping-restart), restarting
nm-openvpn[5682]: SIGUSR1[
[...]
nm-openvpn[5682]: UDPv4 link remote: 192.168.122.1:1194
nm-openvpn[5682]: [server] Peer Connection Initiated with 192.168.122.1:1194
nm-openvpn[5682]: Preserving previous TUN/TAP instance: tun0
nm-openvpn[5682]: /usr/lib/
NetworkManager: <info> VPN plugin failed: 2
nm-openvpn[5682]: script failed: external program exited with error status: 1
nm-openvpn[5682]: Exiting
NetworkManager: <info> VPN plugin failed: 1
NetworkManager: <info> VPN plugin state changed: 6
NetworkManager: <info> VPN plugin state change reason: 0
NetworkManager: <WARN> connection_
NetworkManager: nm_system_
NetworkManager: nm_system_
NetworkManager: <info> Policy set (eth0) as default device for routing and DNS.
nm-dispatcher.
NetworkManager: <debug> [1223468236.827482] ensure_killed(): waiting for vpn service pid 5674 to exit
NetworkManager: <debug> [1223468236.828433] ensure_killed(): vpn service pid 5674 cleaned up
That can occur by default just by inactivity : when connected using a udp-based openvpn, by default it uses "ping-restart 120" which will result in openvpn sending a SIGUSR1 to itself after 120 seconds of VPN inactivity.
Changed in network-manager-openvpn: | |
status: | New → Triaged |
Changed in network-manager: | |
status: | Unknown → Confirmed |
Changed in network-manager: | |
importance: | Unknown → High |
Changed in openvpn: | |
status: | Unknown → New |
tags: | added: oneiric |
Changed in network-manager: | |
status: | Confirmed → Fix Released |
Analysis:
network- manager- openvpn calls openvpn with the "--up /usr/lib/ network- manager- openvpn/ nm-openvpn- service- openvpn- helper" and "--up-restart" parameters. This means that nm-openvpn- service- openvpn- helper will be called when the VPN is initiated ("init" parameter) and restarted ("restart" parameter).
However the environment passed to the script is slightly different in the init and the restart cases. In particular, the "ifconfig_local" environment variable is apparently not set on the restart call.
nm-openvpn- service- openvpn- helper fails if that env var is not set (in file src/nm- openvpn- service- openvpn- helper. c): local") );
g_hash_ table_insert (config, NM_VPN_ PLUGIN_ IP4_CONFIG_ ADDRESS, val);
helper_ failed (connection, "IP4 Address");
val = addr_to_gvalue (getenv ("ifconfig_
if (val)
else
One way to avoid this is to drop the else helper_failed (like in the ifconfig_remote case that follows)...