You are not logged in.

#1 2011-05-04 09:21:22

mallrat
Member
From: Russia, Voronezh
Registered: 2011-03-15
Posts: 9

NetworkManager dispatcher.d won't automatically restart VPN.

I've configured vpnc connection via networkmanager applet. Passwords are saved and I can connect/disconnect it via UI. Also I've wrote a script for the dispatcher.d to reconnect it automatically. Actually the script does the following as root:

nmcli con up id dsr-vpn

Since the latest update (not sure what has been actually changed NM, the Gnome keyring or something else), I'm always getting an auth error:

# nmcli con up id my-vpn
Active connection state: unknown
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/5
state: VPN connecting (need authentication) (2)
Error: Connection activation failed: no valid VPN secrets.

If I'm trying it from the terminal inside my GUI session, it works:

$ nmcli con up id my-vpn
Active connection state: unknown
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/6
state: VPN connecting (need authentication) (2)
state: VPN connecting (3)
state: VPN connecting (getting IP configuration) (4)
Connection activated

But if I'm trying to use su or sudo, it doesn't:

# su - dimm -c "nmcli con up id my-vpn"
Error: Connection activation failed: Not authorized to control networking.
# sudo -u dimm nmcli con up id my-vpn
Error: Connection activation failed: Not authorized to control networking.

I think the problem is in inaccessible dbus session in this case, but I'm not very familiar in it. The ArchWiki page https://wiki.archlinux.org/index.php/Ne … stablished describes a vpn-up.py script, but there is no source code of it... Could anybody help?

Offline

#2 2011-06-06 05:36:50

parshimers
Member
Registered: 2011-05-01
Posts: 2

Re: NetworkManager dispatcher.d won't automatically restart VPN.

ive been having this issue too, it's quite puzzling.
if one does

nmcli con list id <vpn name>

, you'll see that the vpn.secrets field is blank, even if there are secrets listed in the file inside /etc/NetworkManager/system-connections/<vpn-name>. furthermore, given a vpn connection that doesnt even require secrets, it will complain about no valid VPN secrets regardless.
im not sure if this is a bug, or some sort of intended behavior behind my comprehension

also, regarding the python script listed in the wiki page, that doesn't appear to work correctly anymore; it is what i was using for this purpose previously ( and it worked rather well).

Last edited by parshimers (2011-06-06 05:40:36)

Offline

Board footer

Powered by FluxBB