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): val = addr_to_gvalue (getenv ("ifconfig_local")); if (val) g_hash_table_insert (config, NM_VPN_PLUGIN_IP4_CONFIG_ADDRESS, val); else helper_failed (connection, "IP4 Address"); One way to avoid this is to drop the else helper_failed (like in the ifconfig_remote case that follows)... ** Description changed: Binary package hint: network-manager-openvpn Using openvpn rc9-3ubuntu2 and network-manager-openvpn 0.7~~svn20080928t225540-0ubuntu1. When openvpn sends itself a SIGUSR1, network-manager-openvpn calls nm- openvpn-service-openvpn-helper with the "restart" parameter but that fails, resulting in the tearing down of the openvpn connection : nm-openvpn[5682]: [server] Inactivity timeout (--ping-restart), restarting nm-openvpn[5682]: SIGUSR1[soft,ping-restart] received, process restarting [...] 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/network-manager-openvpn/nm-openvpn-service-openvpn-helper tun0 1500 1541 10.8.0.6 10.8.0.5 restart 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_state_changed(): Could not process the request because no VPN connection was active. NetworkManager: nm_system_device_flush_ip4_routes_with_iface: assertion `iface_idx >= 0' failed NetworkManager: nm_system_device_flush_ip4_addresses_with_iface: assertion `iface_idx >= 0' failed NetworkManager: <info> Policy set (eth0) as default device for routing and DNS. nm-dispatcher.action: Script '/etc/NetworkManager/dispatcher.d/01ifupdown' exited with error status 1. 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. - - Running "sudo /usr/lib/network-manager-openvpn/nm-openvpn-service- - openvpn-helper tun0 1500 1541 10.8.0.6 10.8.0.5 restart" on an opened - connection results in: - - ** (process:5944): WARNING **: <WARN> helper_failed(): nm-openvpn- - service-openvpn-helper did not receive a valid VPN gateway from openvpn - - Its return code is 1. -- n-m-openvpn shuts down VPN when openvpn soft-restarts https://bugs.launchpad.net/bugs/280160 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs