Re: API for dispatcher scripts



On Wed, 2015-08-19 at 21:24 +0200, Olaf Hering wrote:
After upgrading from openSUSE 11.4 with NM 0.9.something to openSUSE
Tumbleweed with NM 1.0.2 I was under the impression that the
interface/API for the scripts in /etc/NetworkManager/dispatcher.d is
much more reliable, and much more informative.

But just now I got a different interface for the up and the down event
of a gsm connection. Thankfully the DEVICE_IFACE is the same for the up
and down event, so I will adjust my scripts to use that.

On another host I get different environment for initial vpn-up and a vpn
restart. The latter lacks the route info because that is not provided
during restart after the vpn gateway timed out. Right now I dont have
the exact env data at hand, but I have added logging now to compare both
variants. Perhaps there are already ways to catch both.


I wonder if there is any promise for the called scripts, or if its just
more or less random data that is provided as cmdline arguments and
environment.

The dispatcher scripts get called (since at least May 2011) with the 'IP
interface' of the device, because that's what is almost always useful
for IP and routing operations:

        /* Backwards compat: 'iface' is set in this order:
         * 1) VPN interface name
         * 2) Device IP interface name
         * 3) Device interface anme
         */
        if (vpn_ip_iface)
                *out_iface = g_strdup (vpn_ip_iface);
        else if (ip_iface)
                *out_iface = g_strdup (ip_iface);
        else
                *out_iface = g_strdup (iface);

in your case, the modem's control interface (and thus the NM Device
name) is cdc-wdm0 but the actual interface that IP will run on is
wwp0s29f7u2i4.  Does that make sense?

If you're able to get logs from NM 0.9.x showing this isn't the case
there, I'd love to see them to figure out why they're doing that.

Dan

Olaf


Wed Aug 19 19:01:07 UTC 2015
124.10 115.21
/etc/NetworkManager/dispatcher.d/01-dnsmasq-conf.sh wwp0s29f7u2i4 up
CONNECTION_FILENAME=/etc/NetworkManager/system-connections/Vodafone WebSessions
CONNECTION_ID=Vodafone WebSessions
CONNECTION_UUID=9d9f7b94-b534-4a68-b78c-ba4e1899d4b3
DEVICE_IFACE=cdc-wdm0
DEVICE_IP_IFACE=wwp0s29f7u2i4
DHCP4_BROADCAST_ADDRESS=10.230.151.223
DHCP4_DHCP_LEASE_TIME=7200
DHCP4_DHCP_MESSAGE_TYPE=5
DHCP4_DHCP_SERVER_IDENTIFIER=10.230.151.221
DHCP4_DOMAIN_NAME_SERVERS=139.7.30.125 139.7.30.126
DHCP4_EXPIRY=1440018067
DHCP4_HOST_NAME=esprimo
DHCP4_IP_ADDRESS=10.230.151.220
DHCP4_NETWORK_NUMBER=10.230.151.220
DHCP4_REQUESTED_BROADCAST_ADDRESS=1
DHCP4_REQUESTED_DOMAIN_NAME=1
DHCP4_REQUESTED_DOMAIN_NAME_SERVERS=1
DHCP4_REQUESTED_DOMAIN_SEARCH=1
DHCP4_REQUESTED_HOST_NAME=1
DHCP4_REQUESTED_INTERFACE_MTU=1
DHCP4_REQUESTED_MS_CLASSLESS_STATIC_ROUTES=1
DHCP4_REQUESTED_NDS_CONTEXT=1
DHCP4_REQUESTED_NDS_SERVERS=1
DHCP4_REQUESTED_NDS_TREE_NAME=1
DHCP4_REQUESTED_NETBIOS_DD_SERVER=1
DHCP4_REQUESTED_NETBIOS_NAME_SERVERS=1
DHCP4_REQUESTED_NETBIOS_NODE_TYPE=1
DHCP4_REQUESTED_NETBIOS_SCOPE=1
DHCP4_REQUESTED_NIS_DOMAIN=1
DHCP4_REQUESTED_NIS_SERVERS=1
DHCP4_REQUESTED_NTP_SERVERS=1
DHCP4_REQUESTED_RFC3442_CLASSLESS_STATIC_ROUTES=1
DHCP4_REQUESTED_ROUTERS=1
DHCP4_REQUESTED_STATIC_ROUTES=1
DHCP4_REQUESTED_SUBNET_MASK=1
DHCP4_REQUESTED_WPAD=1
DHCP4_ROUTERS=10.230.151.221
DHCP4_SUBNET_MASK=255.255.255.252
IP4_ADDRESS_0=10.230.151.220/30 10.230.151.221
IP4_GATEWAY=10.230.151.221
IP4_NAMESERVERS=139.7.30.125 139.7.30.126
IP4_NUM_ADDRESSES=1
IP4_NUM_ROUTES=0
IP6_GATEWAY=::
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/
SHLVL=1
_=/usr/bin/env

Wed Aug 19 19:11:52 UTC 2015
768.50 1344.47
/etc/NetworkManager/dispatcher.d/01-dnsmasq-conf.sh cdc-wdm0 down
CONNECTION_FILENAME=/etc/NetworkManager/system-connections/Vodafone WebSessions
CONNECTION_ID=Vodafone WebSessions
CONNECTION_UUID=9d9f7b94-b534-4a68-b78c-ba4e1899d4b3
DEVICE_IFACE=cdc-wdm0
DEVICE_IP_IFACE=cdc-wdm0
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/
SHLVL=1
_=/usr/bin/env

_______________________________________________
networkmanager-list mailing list
networkmanager-list gnome org
https://mail.gnome.org/mailman/listinfo/networkmanager-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]