Re: Is udev necessary for NM plug-in?
I've made a mistake that I didn't make autoconnect=TRUE for the connection. This is why the system configuration was not correctly setup:P. As a result, I can setup connection totally without udev. So what we can benefit from udev? Why does ifupdown use it? On Thu, Apr 22, 2010 at 11:12 AM, Mu Qiao qiao...@gmail.com wrote: Hi all, I'm writing a plugin for Gentoo. I've read the source code of ifupdown and ifcfg-rh. I find that ifupdown use udev to bind device to connection. The main work it has done during binding is getting the mac address of network interface through udev API and adding it to corresponding connection setting. However, I didn't find the same thing in ifcfg-rh. So I've tried to omit the udev part for my gentoo plugin. After starting NetworkManager, although I can see the connection managed by my plugin via nm-applet, ifconfig command shows that the network isn't correctly setup. Do I need to set mac address for each connection to let them work correctly? Or there are other things that I didn't handle in the right way? I've tried to remove mac address saved in /etc/sysconfig/network-scripts/ifcfg-eth*, but NM still works correctly. -- Best wishes, Mu Qiao -- Best wishes, Mu Qiao ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: howto ignore rfkill switch
On Wed, 21 Apr 2010 18:49:23 -0600 Jim Cromie jim.cro...@gmail.com wrote: On Wed, Apr 21, 2010 at 4:24 PM, Vladimir Botka vbo...@gmail.com wrote: On Wed, 21 Apr 2010 16:09:19 -0600 Jim Cromie jim.cro...@gmail.com wrote: Im willing to disable the rfkill code thats shutting things down, but would appreciate advice on how to do so, or whether theres a simpler approach that avoids code changes (my hope). Install the rfkill utility and check the status [1]. Maybe you succeed to rfkill unblock .. it. # rfkill list all 0: sony-wifi: Wireless LAN Soft blocked: no Hard blocked: no 1 - with only built-in wifi card, I get a blank list. [j...@harpo ~]$ rfkill list all [j...@harpo ~]$ lsmod | grep ipw ipw2200 115811 0 libipw 20827 1 ipw2200 lib802114062 2 ipw2200,libipw Yes. The same here. Just the bluetooth rfkill interface. Unfortunately if there is no interface available I have no other hints. Maybe pincers ? # lsmod | grep ipw ipw2200 193740 0 libipw 45936 1 ipw2200 lib802117460 2 ipw2200,libipw # rfkill list all 0: tpacpi_bluetooth_sw: Bluetooth Soft blocked: no Hard blocked: no 1: hci0: Bluetooth Soft blocked: no Hard blocked: no Cheers, -vlado ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Web login
Dan Williams dcbw at redhat.com writes: I've long wondered what Windows Vista and later do for this, since they have some sort of functionality to detect whether you're connected to the internet or not. Maybe we could take a similar approach? Windows certainly doesn't make you enter the addresses of various sites you'd like to ping. I found Vista machines request http://www.msftncsi.com/ncsi.txt when they access my network. Seems to be described here: http://technet.microsoft.com/en-us/library/cc766017(WS.10).aspx --Tobias ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Add vpn connections disabled
I've seen a lot of posts of users complaining about this. In most of the cases the problem was that the appropriate plug-ins weren't installed. But I have installed the pptp, cisco, and openvpn plugins, I've restarted dbus and the network manager, but the add button is disabled. I just want to connect to the vpn described here: http://www.win.tue.nl/bcf/diensten/netwerk/vpn.php Thanks in advance, Damian. ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Add vpn connections disabled
Hi Damian, It will be a great help if you say which version of NM you're using, which distribution, and what internet connection you have. 2010/4/22 Damian Nadales Agut d.e.nadales.a...@tue.nl I've seen a lot of posts of users complaining about this. In most of the cases the problem was that the appropriate plug-ins weren't installed. But I have installed the pptp, cisco, and openvpn plugins, I've restarted dbus and the network manager, but the add button is disabled. I just want to connect to the vpn described here: http://www.win.tue.nl/bcf/diensten/netwerk/vpn.php Thanks in advance, Damian. ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Is udev necessary for NM plug-in?
On Thu, 2010-04-22 at 15:04 +0800, Mu Qiao wrote: I've made a mistake that I didn't make autoconnect=TRUE for the connection. This is why the system configuration was not correctly setup:P. As a result, I can setup connection totally without udev. So what we can benefit from udev? Why does ifupdown use it? Mainly because the /etc/network/interfaces file describes the network settings for a particular *interface*, not generic connections that can be applied to any device. So you have settings for eth0, settings for wlan0, etc. (apparently these config blocks aren't *necessarily* tied to a specific interface, but everyone uses them this way) But the problem (and what NM tries hard to avoid) is that configuration does not have to be specific to an interface, and you certainly don't want just one configuration for an interface. If you're at home, eth0 might be using DHCP, but at work it might be static IP. But since people who use /etc/network/interfaces directly expect that the block for eth0 will only apply to eth0. So ifupdown uses udev to grab the MAC address for eth0, and lock the NMConnection that it makes out of that /e/n/i block only to eth0. If it didn't do this, then the NMConnection that it made would apply to *any* ethernet connection, including a USB dongle you plug in. Dan On Thu, Apr 22, 2010 at 11:12 AM, Mu Qiao qiao...@gmail.com wrote: Hi all, I'm writing a plugin for Gentoo. I've read the source code of ifupdown and ifcfg-rh. I find that ifupdown use udev to bind device to connection. The main work it has done during binding is getting the mac address of network interface through udev API and adding it to corresponding connection setting. However, I didn't find the same thing in ifcfg-rh. So I've tried to omit the udev part for my gentoo plugin. After starting NetworkManager, although I can see the connection managed by my plugin via nm-applet, ifconfig command shows that the network isn't correctly setup. Do I need to set mac address for each connection to let them work correctly? Or there are other things that I didn't handle in the right way? I've tried to remove mac address saved in /etc/sysconfig/network-scripts/ifcfg-eth*, but NM still works correctly. -- Best wishes, Mu Qiao ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Suggestion for Shared Connection: Reserve IPs for MAC Addresses
Hi all, I saw a discussion initiated by Andy Ringsmuth in Sep. 2009 regarding changing the DHCP range in Network Manager (http://www.mail-archive.com/networkmanager-list@gnome.org/msg13788.html). In addition to what Andy suggested, I'd like add another feature that goes even further than just controlling the range of IPs and Subnet: * Reserve IP addresses for specific MAC addresses * Do not hand out addresses from the defined range other than for reserved MAC addresses. I know, that this is way beyond making NM simple, but I would really like see this feature. Also, what happens if you have multiple interface set to shared? Will NM automatically use a different IP subnets? Or will it fail? Can't really test this here since I only have two interfaces to play with (one WiFi, one wired). Anyway... Would anybody like to share his/her thoughts on that? Kay -- Kay Wrobel kwro...@letterboxes.org -- http://www.fastmail.fm - Does exactly what it says on the tin ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: howto ignore rfkill switch
On Wed, 2010-04-21 at 18:49 -0600, Jim Cromie wrote: On Wed, Apr 21, 2010 at 4:24 PM, Vladimir Botka vbo...@gmail.com wrote: On Wed, 21 Apr 2010 16:09:19 -0600 Jim Cromie jim.cro...@gmail.com wrote: Im willing to disable the rfkill code thats shutting things down, but would appreciate advice on how to do so, or whether theres a simpler approach that avoids code changes (my hope). Install the rfkill utility and check the status [1]. Maybe you succeed to rfkill unblock .. it. # rfkill list all 0: sony-wifi: Wireless LAN Soft blocked: no Hard blocked: no thanks Vlado, that gets me more info (but no solution yet) 1 - with only built-in wifi card, I get a blank list. [j...@harpo ~]$ rfkill list all [j...@harpo ~]$ lsmod | grep ipw ipw2200 115811 0 libipw 20827 1 ipw2200 lib802114062 2 ipw2200,libipw 2 - once I plug in the pcmcia and usb cards, theyre both unblocked, but the builtin (ipw2200) is still missing. [j...@harpo ~]$ rfkill list all 1: phy1: Wireless LAN Soft blocked: no Hard blocked: no 2: phy2: Wireless LAN Soft blocked: no Hard blocked: no Blocking and unblocking alters the displayed state (as above) but NM-applet says that all 3 are disabled. Yes, for a number of reasons. First, we can't usually figure out which killswitch is for which wifi device. It's often just not possible, plus platform killswitches provided by your laptop BIOS aren't tied to a specific wifi device. Second, you're probably better off blacklisting the internal wifi driver modules so they simply don't load in the first place. Add the names (libipw, ipw2200) to to /etc/modprobe.d/blacklist.conf to do this. If you rmmod ipw2200, what happens? Dan ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Add vpn connections disabled
On Thu, 2010-04-22 at 15:12 +0200, Damian Nadales Agut wrote: I've seen a lot of posts of users complaining about this. In most of the cases the problem was that the appropriate plug-ins weren't installed. But I have installed the pptp, cisco, and openvpn plugins, I've restarted dbus and the network manager, but the add button is disabled. I just want to connect to the vpn described here: http://www.win.tue.nl/bcf/diensten/netwerk/vpn.php What's in /etc/NetworkManager/VPN/ ? What are the contents of those files? Did you reboot the entire machine, or just restart NM? Dan ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Suggestion for Shared Connection: Reserve IPs for MAC Addresses
Understood, and it would be a separate install and configuration from NetworkManager. I was suggesting to make this feature available in the NetworkManager GUI in a simplified manner, sort of like the Routes button under the IPv4 tab that allows you some more complex settings for routing. Also, NM uses dnsmasq to accomplish this and not dhcp3-server. Thoughts? Kay On Thu, 22 Apr 2010 12:48 -0300, José Queiroz zekk...@gmail.com wrote: 2010/4/22 Kay Wrobel [1]kwro...@letterboxes.org * Reserve IP addresses for specific MAC addresses * Do not hand out addresses from the defined range other than for reserved MAC addresses. These functions are handled, now, by the DHCP server... ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list References 1. mailto:kwro...@letterboxes.org -- Kay Wrobel kwro...@letterboxes.org -- http://www.fastmail.fm - Does exactly what it says on the tin ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: howto ignore rfkill switch
On 04/22/2010 08:44 AM, Dan Williams wrote: On Wed, 2010-04-21 at 18:49 -0600, Jim Cromie wrote: Yes, for a number of reasons. First, we can't usually figure out which killswitch is for which wifi device. It's often just not possible, plus platform killswitches provided by your laptop BIOS aren't tied to a specific wifi device. Dan On a similar vein, I have issues every time I resume from suspend with my HP laptop. I have both a platform rfkill and a phy0 rfkill, and soft-blocking the platform rfkill hard-blocks the phy0 rfkill. Since NetworkManager refuses to try to unblock ANY rfkill if one is hard-blocked, I end up having to manually rfkill unblock wifi at resume. Is there any way to get NetworkManger to ignore the phy0 rfkill? The assumption that we can't tell what wifi device the platform rfkill applies to, is not quite true, at least for HP: I think it would be a relatively safe bet that the hp-wifi rfkill applies to whatever wifi card is internal (that is, on a non-hotpluggable PCI or PCIe port). 0: hci0: Bluetooth Soft blocked: no Hard blocked: no 1: phy0: Wireless LAN Soft blocked: no Hard blocked: yes 2: hp-wifi: Wireless LAN Soft blocked: yes Hard blocked: no 3: hp-bluetooth: Bluetooth Soft blocked: no Hard blocked: no ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: howto ignore rfkill switch
On Thu, 2010-04-22 at 11:10 -0700, Dana Goyette wrote: On 04/22/2010 08:44 AM, Dan Williams wrote: On Wed, 2010-04-21 at 18:49 -0600, Jim Cromie wrote: Yes, for a number of reasons. First, we can't usually figure out which killswitch is for which wifi device. It's often just not possible, plus platform killswitches provided by your laptop BIOS aren't tied to a specific wifi device. Dan On a similar vein, I have issues every time I resume from suspend with my HP laptop. I have both a platform rfkill and a phy0 rfkill, and soft-blocking the platform rfkill hard-blocks the phy0 rfkill. Since NetworkManager refuses to try to unblock ANY rfkill if one is hard-blocked, I end up having to manually rfkill unblock wifi at resume. Is there any way to get NetworkManger to ignore the phy0 rfkill? Not really; because if the phy is hardblocked, it really is *dead* and it won't be usable at all until that hardblock is removed (by unblocking the platform device). NM doesn't actually *write* to rfkill, it simply reads it. You'll want to use the hardware killswitch (or the platform one, whatever you have) to unblock your wifi when needed. The assumption that we can't tell what wifi device the platform rfkill applies to, is not quite true, at least for HP: I think it would be a relatively safe bet that the hp-wifi rfkill applies to whatever wifi card is internal (that is, on a non-hotpluggable PCI or PCIe port). Ah, but how do you know which cards are actually internal? It's a bit easier for PCI devices, but we certainly don't know for USB devices (and not all USB devices are external, especially bluetooth and WWAN, but also many wifi devices). Also realize that the platform driver has a huge impact here. There can be bugs in the platform driver (hp-wmi, thinkpad-acpi, acer-wmi, asus-laptop, fujitsu-laptop, etc) that make rfkill perform badly. It might also be the case that the autoload magic isn't present in the platform driver for your specific laptop model. I have the same setup on my daily machine (HP 2530p). iwlagn phy killswitch, and an hp-wmi platform killswitch which hardblocks the phy one. There are some ways we can deal with this, but they are complicated and hard to get right. They also include UI changes, because to actually unblock wifi, you have to do something like this: 1) try to unblock each wifi killswitch 2) after doing this, if any killswitches are still blocked, try to unblock any blocked switches again 3) and try it again 4) if any switches are still blocked, the operation has failed, and you somehow alert the user 5) if all switches are unblocked, success This is because the platform killswitch will often hardblock the phy killswitch, so we can't use a hardblock state in the UI anywhere. That also means that we can't tell whether there's actually a hardblock anywhere that has to be fixed by sliding a switch, because we can't trust any phy hardblock (there are some ways around this). Second, not all phy switches are controlled by platform switches. And there's simply no way to tell which platform switches control phy switches, because that's all internal to BIOS and not exposed to the OS. There are some things we can do here, but everyone needs to realize that it's complicated and will take some time to get right. We don't want to deploy a solution that breaks 50% of laptop. Dan ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Re: domainname in serviceproviders.xml
On Mon, 12 Apr 2010 20:52:07 +0200, van Schelve pub...@van-schelve.de wrote: On Thu, 08 Apr 2010 16:40:21 -0700, Dan Williams d...@redhat.com wrote: On Wed, 2010-04-07 at 00:27 +0200, Hans-Gerd van Schelve wrote: Am 06.04.2010 um 22:16 schrieb Dan Williams d...@redhat.com: On Tue, 2010-04-06 at 20:43 +0200, Hans-Gerd van Schelve wrote: Hi. It looks like that nm is still not able to read bluetooth connections from system-connection files. I tested this sometimes but it does not work. So I'm looking for a workaround currently. Our users are not able to use their SIM cards with any APN. These SIM cards are configured by our provider to only allow to use our own private APN. So I'm modifying the following file: /usr/share/mobile-broadband-provider-info/serviceproviders.xml so the user can only select our APN configuration. My Problem is that the domain extension is ignored in this file. I tried domainmycompany.de/ domain but that does not work. Can someone give me a hint? That file doesn't have anything to do with domain or anything. What are you trying to do here? I added our custom apn entry there so our user can select it from the list and removed all the other entries that do not work for us and therefore should not be available Ok, that should work. If you remove everything from that file except your custom APN, it should be the only one shown in the wizard. Hm. No, it's not really possible as I thought first. The missing dns search option is one thing. I have to change the resolve.conf to search mycompany.com and that's not possible. Second thing is that our user are able to see the ppp credentials for username and password. Therefore the system-connection would be the best solution. serviceproviders.xml only handles APNs really (DNS is ignored since it's passed back from PPP). If you want to control the search domains, then you'll want modify the NM connection itself. If there's a problem with BT system connections, we should fix that... Agree. This would be the best. Can I contribute something like special debug that can help to fix it? Can you grab the NM log output for me? And possibly 'dmesg' so we can see if the kernel is misbehaving. Of course. You'll find them at pastebin: http://pastebin.org/148605 http://pastebin.org/148608 Dan, are these logs useful? Is someone else here who can reproduce the problem? Can I contribute something else? Dan HG ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: force broadband connection to H3G network
On Tue, 2010-04-20 at 17:32 +0200, Nicolo' Chieffo wrote: Thanks for the links Gianluca, it was very useful! Is there any plan to improve the GUI with a pre-filled list? Sort of; I assume you're looking for a Scan function that will show what providers are around, and then let you select one to fill the network box with. Or, as long as the roaming status is detected by the card/sim in accordance with standards: http://blogs.gnome.org/dcbw/2010/04/22/qualified-to-satisfy-you/ should show up in the next releases of NM and MM. In the mean time you can enter the MCC/MNC of your provider to use manual registration and avoid roaming. Dan ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: nm-inotify-helper doesn't work in Lenovo T400
On Thu, 2010-04-22 at 11:23 +0800, Mu Qiao wrote: Hi all, I'm using nm-inotify-helper to monitor hostname file in my plugin. The code is nearly the same as ifupdown. However, I find nothing changed after I modified the hostname configuration file both in Ubuntu(ifupdown) and Gentoo(my plugin) which are installed in my laptop. It works correctly in other machines. I've check the kernel configuration: CONFIG_INOTIFY=y CONFIG_INOTIFY_USER=y uname -a: Linux qiaomu-laptop 2.6.30-gentoo-r5 #35 SMP Wed Mar 31 21:44:40 CST 2010 x86_64 Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz GenuineIntel GNU/Linux inotify-tools works properly in my laptop. Interesting; in all distros I've tried this works. Do you get any errors at all, or does everything *appear* to work correctly? Dan ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: AD-Hoc network specify channel
On Sat, 2010-04-17 at 16:02 +0200, Simon Schampijer wrote: On 04/14/2010 10:42 PM, Dan Williams wrote: On Tue, 2010-04-13 at 21:36 +0200, Simon Schampijer wrote: Hi, I am trying to create an Ad-Hoc Network with a specific channel. From the spec [1] I know that I have to set the band as well. However the created network always has channel 1. The nm-applet does not have an option to set the channel, and is using channel one, too. Using iwconfig to create an Ad-Hoc network I can set a channel fine. Is it fully implemented or do I miss something else? It should be, though it's likely not possible if you're using nm-connection-editor since the channel/band aren't accessible there. But looking at it now, they *should* be accessible for ad-hoc connections. So we'll need to whip up some code for page-wifi.c to hide/show them when ad-hoc is selected. Yes, agreed. Having it accessible as a setting from within nm-applet would be nice. (this is because wpa_supplicant only has the ability to set the channel for ad-hoc networks, not a limitation in NM. wpa_supplicant does not have the ability to set a band limitation for infrastructure networks, which means we can't let users limit particular connection to only 802.11a for example) See nm_supplicant_config_add_setting_wireless() in NM for where the frequency gets sent to the supplicant, and build_supplicant_config() for where the channel/band get translated into a frequency. Also check nm_ap_new_fake_from_connection() to ensure that the frequency is getting correctly set on the fake AP. This all should work as long as the connection dict has the band/freq specified. Dan Actually when looking at the logs something caught my eye. The frequency was listed as being 5210 when I specified channel 11 and 'bg' as the band. Looking at the code I found a little typo. Patches for master and the NETWORKMANAGER_0_7 branch are attached. Dan, as always, thanks for taking the time to reply that detailed, Pushed to stable and master, thanks! Dan ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Documentation
Thanks, I don't use the python now. Is there function of activating the connection to Wifi network if I have already setted the SSID., such as nm_device_wifi_get_capabilities (device); I have found nm_client_activate_connectionhttp://projects.gnome.org/NetworkManager/developers/libnm-glib/08/NMClient.html#nm-client-activate-connection( NMClienthttp://projects.gnome.org/NetworkManager/developers/libnm-glib/08/NMClient.html*client, const char *service_name, const char *connection_path, NMDevice http://projects.gnome.org/NetworkManager/developers/libnm-glib/08/NMDevice.html *device, const char *specific_object, NMClientActivateDeviceFn http://projects.gnome.org/NetworkManager/developers/libnm-glib/08/NMClient.html#NMClientActivateDeviceFn callback, gpointer http://projects.gnome.org/NetworkManager/developers/libnm-glib/glib/glib-Basic-Types.html#gpointer user_data); But I don't know how to use this function if I knew the SSID, Channel, username, password. Thank you very much! W On Tue, Mar 30, 2010 at 12:52 PM, Mads Kiilerich m...@kiilerich.com wrote: Dan Williams wrote, On 03/30/2010 09:39 PM: On Fri, 2010-03-26 at 11:10 +0100, Jirka Klimes wrote: On Thursday 25 of March 2010 22:37:34 Bluesky_greenleaf wrote: Thanks, But don't find the some examples in source tree of NM in examples directory. http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/python Actually, there are just 3 examples now. I do need to make a settings service example too, yeah. If anyone has examples to contribute, be they C or python or whatever, lets get them in there. Feel free to take what you can use from http://mail.gnome.org/archives/networkmanager-list/2010-March/msg00111.html /Mads ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: keyfile plugin initialization and wireless at boot
On Tue, 2010-04-20 at 17:48 +0200, Jirka Klimes wrote: I've tried that as well and can confirm a problem. I rebooted to Ubuntu and added this line to /etc/network/interfaces iface eth0 inet dhcp That triggers the problem. I looked into it a bit to find the cause. This is what is going on, IMO: Good diagnosis, though I think what we should do is something like this: diff --git a/src/system-settings/nm-sysconfig-settings.c b/src/system-settings/nm-sysconfig-settings.c index 0054a99..4bcfb04 100644 --- a/src/system-settings/nm-sysconfig-settings.c +++ b/src/system-settings/nm-sysconfig-settings.c @@ -357,8 +357,6 @@ add_plugin (NMSysconfigSettings *self, NMSystemConfigInterface *plugin) g_signal_connect (plugin, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, G_CALLBACK (plugin_connection_added), self); - g_signal_connect (plugin, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED, - G_CALLBACK (unmanaged_specs_changed), self); g_signal_connect (plugin, notify::hostname, G_CALLBACK (hostname_changed), self); nm_system_config_interface_init (plugin, NULL); @@ -368,6 +366,9 @@ add_plugin (NMSysconfigSettings *self, NMSystemConfigInterface *plugin) NM_SYSTEM_CONFIG_INTERFACE_INFO, pinfo, NULL); + g_signal_connect (plugin, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED, + G_CALLBACK (unmanaged_specs_changed), self); + nm_log_info (LOGD_SYS_SET, Loaded plugin %s: %s, pname, pinfo); g_free (pname); g_free (pinfo); @@ -1328,6 +1329,7 @@ nm_sysconfig_settings_new (const char *config_file, g_object_unref (self); return NULL; } + unmanaged_specs_changed (NULL, self); } return self; can you test and see if that works? If so, feel free to push to git. Thanks! Dan src/system-settings/nm-sysconfig-settings.c:load_plugins() function is used to load configured plugins. It adds the plugins to internal list that is used further in the code; this is done via add_plugin() function. In addition, add_plugin() funtion calls nm_system_config_interface_init (plugin, NULL) to initialize the plugin beeing added. In case of 'ifupdown' SCPluginIfupdown_init (plugin.c) is invoked and it adds well-known interfaces via udev_device_added(). Here the working and not working case are forking. Without 'iface eth0 ...', the function returns (log message: device added (path: %s, iface: %s): no ifupdown configuration found.). However with eth0 present in interfaces file, g_signal_emit_by_name (G_OBJECT (self), NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED) is called. That casues NM to invoke nm_sysconfig_settings_get_unmanaged_specs() and load_connections() in turn from src/system-settings/nm-sysconfig-settings.c. *BUT* in this moment only 'ifupdown' plugin has been loaded. And because load_connections() is protected via 'connections_loaded' guard, it won't load connections from 'keyfile' plugin later when it is added by add_plugin(). The attached patch should fix the problem. Basically, it adds another boolean guard to load_connections() causing that it loads the connections only after *all* plugins have been loaded. Nevertheless, not sure if this is the right solution. Here is a stack from gdb (it's clearer that my description): Breakpoint 1, load_connections (self=0x80ef018) at nm-sysconfig-settings.c:133 133 NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); (gdb) bt #0 load_connections (self=0x80ef018) at nm-sysconfig-settings.c:133 #1 0x080b94c3 in nm_sysconfig_settings_get_unmanaged_specs (self=0x80ef018) at nm-sysconfig-settings.c:248 #2 0x080bc583 in get_property (object=0x80ef018, prop_id=1, value=0x80de330, pspec=0x80e0340) at nm-sysconfig-settings.c:1428 #3 0x003684b8 in g_object_get_property () from /usr/lib/libgobject-2.0.so.0 #4 0x080b93dc in notify (object=0x80ef018, pspec=0x80e0340) at nm-sysconfig- settings.c:233 #5 0x00372118 in g_cclosure_marshal_VOID__PARAM () from /usr/lib/libgobject-2.0.so.0 #6 0x003636f9 in ?? () from /usr/lib/libgobject-2.0.so.0 #7 0x00365072 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0 #8 0x0037a0b0 in ?? () from /usr/lib/libgobject-2.0.so.0 #9 0x0037bb2d in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0 #10 0x0037bfb6 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0 #11 0x003693e1 in ?? () from /usr/lib/libgobject-2.0.so.0 #12 0x00365daf in ?? () from /usr/lib/libgobject-2.0.so.0 #13 0x0036aec3 in g_object_notify () from /usr/lib/libgobject-2.0.so.0 #14 0x080b9886 in unmanaged_specs_changed (config=0x80f5640, user_data=0x80ef018) at nm-sysconfig-settings.c:343 #15 0x003729fc in g_cclosure_marshal_VOID__VOID () from /usr/lib/libgobject-2.0.so.0
Re: nm-inotify-helper doesn't work in Lenovo T400
On Fri, Apr 23, 2010 at 8:00 AM, Dan Williams d...@redhat.com wrote: On Thu, 2010-04-22 at 11:23 +0800, Mu Qiao wrote: Hi all, I'm using nm-inotify-helper to monitor hostname file in my plugin. The code is nearly the same as ifupdown. However, I find nothing changed after I modified the hostname configuration file both in Ubuntu(ifupdown) and Gentoo(my plugin) which are installed in my laptop. It works correctly in other machines. I've check the kernel configuration: CONFIG_INOTIFY=y CONFIG_INOTIFY_USER=y uname -a: Linux qiaomu-laptop 2.6.30-gentoo-r5 #35 SMP Wed Mar 31 21:44:40 CST 2010 x86_64 Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz GenuineIntel GNU/Linux inotify-tools works properly in my laptop. Interesting; in all distros I've tried this works. Do you get any errors at all, or does everything *appear* to work correctly? Dan I used inotify-tools both in Gentoo and Ubuntu like this: inotifywait -rme modify,attrib,move,close_write,create,delete,delete_self /home/user/temp I tried to modify the file and I can see messages like this: /home/user/temp/ MODIFY host /home/user/temp/ CLOSE_WRITE,CLOSE host So I guess inotify works. In addition, I think everything appears to work correctly except inotify. In Ubuntu, I started NetworkManager and confirmed that ifupdown was started and running in managed mode. Modification to /etc/network/interfaces could be reflected after restart NetworkManager. But after I modified /etc/hostname, the hostname didn't change when using hostname command. The same thing happened in Gentoo. No log generated when I modify /etc/conf.d/hostname(Gentoo) and /etc/hostname(Ubuntu). Below is the log generated when the nm starts in . I didn't see anything wrong except one dbus warn. If there is something I didn't mention, please let me know. Gentoo: Apr 23 11:54:26 qiaomu-laptop NetworkManager: info starting... Apr 23 11:54:26 qiaomu-laptop NetworkManager: info modem-manager is now available Apr 23 11:54:26 qiaomu-laptop NetworkManager:SCPluginIfnet: Initializing! Apr 23 11:54:26 qiaomu-laptop NetworkManager:SCPlugin-Ifnet: Updating hostname Apr 23 11:54:26 qiaomu-laptop NetworkManager:SCPlugin-Ifnet: Hostname: qiaomu-laptop Apr 23 11:54:26 qiaomu-laptop NetworkManager:SCPluginIfnet: guessed connection type (eth0) = 802-3-ethernet Apr 23 11:54:26 qiaomu-laptop NetworkManager:SCPlugin-Ifnet: update_connection_setting_from_config_block: name:eth0, type:802-3-ethernet, id:system connection (eth0), uuid: 4c63e3cf-0478-90de-9bec-06f79f04a5a3 Apr 23 11:54:26 qiaomu-laptop NetworkManager:SCPlugin-Ifnet: new address Apr 23 11:54:26 qiaomu-laptop NetworkManager:SCPlugin-Ifnet: addresses count: 1 Apr 23 11:54:26 qiaomu-laptop NetworkManager:SCPlugin-Ifnet: new address Apr 23 11:54:26 qiaomu-laptop NetworkManager:SCPlugin-Ifnet: addresses count: 2 Apr 23 11:54:26 qiaomu-laptop NetworkManager:SCPlugin-Ifnet: Add new dns Apr 23 11:54:26 qiaomu-laptop NetworkManager:SCPlugin-Ifnet: Add new dns Apr 23 11:54:26 qiaomu-laptop NetworkManager:SCPlugin-Ifnet: Verify connection eth0:1 Apr 23 11:54:26 qiaomu-laptop NetworkManager:SCPlugin-Ifupdown: autoconnect: eth0 Apr 23 11:54:26 qiaomu-laptop NetworkManager:SCPluginIfnet: Initialzation complete! Apr 23 11:54:26 qiaomu-laptop NetworkManager: Loaded plugin ifnet: Gentoo Foundation Apr 23 11:54:26 qiaomu-laptop NetworkManager: Loaded plugin keyfile: (c) 2007 - 2008 Red Hat, Inc. To report bugs please use the NetworkManager mailing list. Apr 23 11:54:26 qiaomu-laptop NetworkManager: info Found wlan radio killswitch rfkill1 (at /sys/devices/pci:00/:00:1c.1/:03:00.0/rfkill/rfkill1) (driver iwlagn) Apr 23 11:54:26 qiaomu-laptop dbus-daemon: [system] Rejected send message, 2 matched rules; type=method_call, sender=:1.20 (uid=1000 pid=4994 comm=nm-applet) interface=org.freedesktop.DBus.Properties member=Get error name=(unset) requested_reply=0 destination=org.freedesktop.NetworkManager (uid=0 pid=5181 comm=/usr/sbin/NetworkManager)) Apr 23 11:54:26 qiaomu-laptop NetworkManager: info WiFi enabled by radio killswitch; enabled by state file Apr 23 11:54:26 qiaomu-laptop NetworkManager: info WWAN enabled by radio killswitch; enabled by state file Apr 23 11:54:26 qiaomu-laptop NetworkManager:SCPlugin-Ifnet: (17433040) ... get_connections. Apr 23 11:54:26 qiaomu-laptop NetworkManager:SCPlugin-Ifnet: (17433040) connections count: 1 Apr 23 11:54:26 qiaomu-laptop NetworkManager: Ignoring insecure configuration file '/etc/NetworkManager/system-connections/.keep_net-misc_networkmanager-0' Apr 23 11:54:26 qiaomu-laptop NetworkManager: info (eth0): carrier is ON Apr 23 11:54:26 qiaomu-laptop NetworkManager: info (eth0): new Ethernet device (driver: 'e1000e') Apr 23 11:54:26 qiaomu-laptop NetworkManager: info (eth0): exported as /org/freedesktop/NetworkManager/Devices/0 Apr 23 11:54:26 qiaomu-laptop NetworkManager: info (eth0): now managed Apr 23 11:54:26