Re: Network Manager does not find system wide connections

On Sat, 2009-07-25 at 01:13 +0200, Hadmut Danisch wrote:
> Hi,
> maybe someone can give me a hint about where to start debugging:
> I am using Ubuntu 9.04 on several machines. On some machines Network
> Manager works as expected when making connections system wide available
> with the connection editor: It puts a file into
> /etc/NetworkManager/system-connections. When starting
> nm-connection-editor, they appear as connections, and they can be used
> as normal.
> But then on two of my machines this does not work. When setting
> connections to system wide availability, it puts a file into
> /etc/NetworkManager/system-connections as well, but then does not find
> it again, as if the file would not exist. Network connections are not
> configured, and nm-connection-editor does not find it (i.e. does not
> display the connection).
> I wrote a little tool to fetch connections from dbus. It works on those
> machines where nm works, but it returns an emtpy list of connections on
> those machines where it doesn't.
> debugging with strace showed that nm-system-connections does not look at
> all into /etc/NetworkManager/system-connections at all. Reading the
> source code is almost pointless, highly complex without any comments,
> source code of the quality 'virtually unreadable'.

Depends on your point of view; yes, more comments and explanation of
theory are needed (especially in the public API).  But the processes are
also quite complex, and a familiarity with GObject and some of the
technologies used (PolicyKit, GObject, dbus-glib) is assumed.

You'll want to start looking in the keyfile's
system-settings/plugins/keyfile/plugin.c dir_changed() function.  That
function is called whenever inotify sees new files or changes in the
config directory.  Does that function get called when the new file
appears there?  Since the new keyfile appears at all, I assume that
means the keyfile plugin is loaded (otherwise nothing would get written
to that directory in the first place).

Eventually this code will be triggered in dir_chagned():

			/* New */
			connection = nm_keyfile_connection_new (name);
			if (connection) {
				NMConnection *tmp;
				NMSettingConnection *s_con;
				const char *connection_uuid;
				NMKeyfileConnection *found = NULL;

which creates a new keyfile connection from the file.  It would be
useful to see if 'connection' is NULL after this, which indicates an
invalid file format, whcih would indicate a bug in the keyfile code.

Any chance you could dig down a bit more to see what's going on?  Even
just setting a breakpoint on dir_changed() would be useful to ensure
it's getting triggered when a new keyfile gets created there.


> I still could not figure out what makes the difference between those
> machines where it works and those where it doesn't.
> Any idea or hint?
> regards
> Hadmut
> _______________________________________________
> NetworkManager-list mailing list
> NetworkManager-list gnome org

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