LWN.net Logo

The Grumpy Editor encounters the Hardy Heron

The Grumpy Editor encounters the Hardy Heron

Posted Apr 23, 2008 18:22 UTC (Wed) by madscientist (subscriber, #16861)
In reply to: The Grumpy Editor encounters the Hardy Heron by cortana
Parent article: The Grumpy Editor encounters the Hardy Heron

Probably you don't use it in an enterprise setting, and/or you've never tried to take it out
of roaming mode.  Here are a few examples: my environment is a traditional UNIX Enterprise
setup where password, group, and automount data is transferred via NIS.  When NM is being
used, the network is not up when the next service is being initialized.  Instead, you're
supposed to wait for a dbus message.  So, the system starts up, NM comes up and starts
broadcasting for a DHCP service or whatever.  Meanwhile, NIS comes up, but there's no network.
Now, someone has hacked NIS (which is a service invented by Sun back in the 1980's!!) to
listen for dbus messages, so it sits there waiting for NM to get a network and the system
continues to start services.  So, next, autofs starts up and tries to read the automount maps
from NIS.  But, NIS is not started, so no maps are available.  So, I have nothing
automountable.  I have to wait until AFTER my system comes up, then go in and restart autofs
by hand so that it will read my maps properly from the now-running network.  Stupid.

But wait, you say!  This isn't NM's fault!  autofs should be enhanced to grok dbus messages!
Bullhooey.  NIS and autofs and other services like that have been around for 20 years, some of
them.  They are used across a huge variety of UNIX systems, not just Linux.  Saying that all
these services have to be modified to interact with the Linux-specific dbus just so they can
communicate with NM is wrong.  It's just the wrong design.  I can't believe someone enhanced
ypbind for this, and I certainly can't support continuing to modify more services in this way.
Whatever the right solution IS, it is assuredly NOT to continue to graft on specialized
"one-off" features like this to standard, portable services.  Maybe the right answer is for NM
to provide a generic dbus "listener" program that can be invoked as a wrapper around legacy
services like nis and autofs, and run standard sysv service operations like "/etc/init.d/nis
start" or whatever when the proper dbus messages are received.

So, that's the main thing.  The other thing is that NM likes to bring down the network.  On
one of the Fedora boxes I was using it would bring down the network every time I logged out!
So annoying.  That may be the right thing to do on a laptop where, when you log out, you may
want your wireless interface to go down so others can't use it, but it makes absolutely zero
sense for a wired desktop.  This doesn't happen on Ubuntu so maybe that was a Fedora
"feature".

The last example may not be NM: I'm not really clear exactly where the Gnome tools stop and NM
proper begins.  However, on Ubuntu Hardy I go to my network management utility and I turn off
roaming mode, and set my interface to use DHCP (I did this in the hopes of solving the above
problem: I actually wanted NetworkManager to go away and to get back to the traditional
model).  Well, I look at /etc/network/interfaces and sure enough, I see the right thing there.
But oh no!  Now I can't use sudo anymore!  I have no root access!  What happened?  Well,
turned out that my /etc/hosts file was mucked up and I no longer had an entry for my local
host, and sudo requires that before it will let you log in.  Since there's no root password on
an Ubuntu system, I had to boot off a rescue CD, mount the root partition, and fix the
/etc/hosts file by hand.  Nice.

NM may be great if you have networks that change, but it's nothing but headaches for (probably
still the majority of) people who just want to use the same network from bootup to shutdown.


(Log in to post comments)

The Grumpy Editor encounters the Hardy Heron

Posted Apr 24, 2008 9:28 UTC (Thu) by jamesh (subscriber, #1159) [Link]

It sounds like your complaint boils down to "autofs should start after NIS, which in turn
should start after the network is up", and "the NetworkManager startup script completes before
the network is up".

Having NIS, autofs, etc talk DBus and sit around doing nothing until the network is up is one
option.

Another option is to trigger the start of these services when the network comes up rather than
when the system boots.  Upstart offers some of the infrastructure that could be used to
implement this kind of policy -- what needs to be done now is to fix up the startup scripts.

The Grumpy Editor encounters the Hardy Heron

Posted Apr 24, 2008 15:03 UTC (Thu) by madscientist (subscriber, #16861) [Link]

Actually, that is just a specific example of a general principle: NM is not ready for LTS, or
at least it should not be enabled for all LTS users.  Whether that's because of problems in NM
itself (which there do appear to be, such as the /etc/hosts mangling) or because Ubuntu (and
Fedora, from comments here and other places) just haven't managed to integrate it properly, is
almost beside the point.  If NM is going to REQUIRE changes to fundamental infrastructure that
has existed for decades before it will allow your network to operate correctly, then that
infrastructure needs to be changed and working BEFORE NM is deployed, especially in an LTS
release.

My second point is that the current apparent design solution for deploying NM (modify the code
of all network-related services to grok NM dbus messages) is fundamentally WRONG.  It's not
portable, it's not scalable, it's time-intensive, it's duplicating work, it's error prone, and
it's not The UNIX Way.  Whether that's how NM recommends it should work, I don't know: maybe
it's not NM but rather the distros trying to integrate NM that are making these decisions.  I
already suggested one way that NM could mitigate this, by providing a wrapper utility that can
manage dbus messages and translate them into "traditional" network service operations.  You
suggest another way, which is to enhance the network services to use Upstart which,
presumably, is already integrated into dbus, rather than, or in addition to, the traditional
sysv init scripts.  That would be fine with me as well.

Basically, NM may be great for people with complicated network requirements but it just breaks
things for people with simple network requirements, with no added benefit.  This is
unacceptable, especially for an LTS release.  Whether that's NM's fault, Ubuntu's fault, or a
combination I'm not sure.

The Grumpy Editor encounters the Hardy Heron

Posted Apr 29, 2008 11:52 UTC (Tue) by broonie (subscriber, #7078) [Link]

There's more to it than that - if the network connection is at all bouncy (on laptops it's
relatively likely to be so) you end up needing to kick services that depend on it whenever
there is a network status change.

The Grumpy Editor encounters the Hardy Heron

Posted Apr 24, 2008 9:39 UTC (Thu) by deleteme (guest, #49633) [Link]

The problem with NetworkManager  removing localhost from /etc/hosts is quite unforgivable.
It's never happened me to this date, and I've done this alot. So I hope I wont have this
problem with 8.04..

The Grumpy Editor encounters the Hardy Heron

Posted Apr 24, 2008 15:17 UTC (Thu) by madscientist (subscriber, #16861) [Link]

It doesn't remove localhost; it removes your local host name (or maybe it mangles it, I can't
remember exactly).  So if you name your system "myubuntu", that name is no longer correctly
present in /etc/hosts which means sudo does not allow you to log in.

FYI, here's the Launchpad bug:
https://bugs.launchpad.net/ubuntu/+source/network-manager...  Note that I had the
same failure on my system by disabling "roaming mode" in my network config applet and setting
my system to use DHCP.  This is all through the GUI, using "supported" methods of configuring
the system.  There have been reports that just upgrading to the new release caused this
problem, although I did this on my system at home last night and it worked (I didn't try to
reset the network config though).

There is also a bug reported against sudo for this:
https://bugs.edge.launchpad.net/ubuntu/+source/sudo/+bug/...  Contrary to the strident
assertions of folks like asmoore82, I do believe this is a bug, or at the very least an
important enhancement.  Or, if not, maybe it's proof that sudo is not the right solution for
Ubuntu.  I actually really like this model of no root password / use sudo for everything that
Ubuntu uses... but there should NEVER be a situation where a simple thing like messing up your
/etc/hosts file causes you to no longer be able to log in with administrator privileges and
FIX a problem like messing up your /etc/hosts file.  A typo in a file like that should NEVER
require resorting to the rescue disk, mounting a partition by hand, and editing the file to
fix the problem.

The Grumpy Editor encounters the Hardy Heron

Posted Apr 24, 2008 16:49 UTC (Thu) by Hawke (subscriber, #6978) [Link]

I am appalled.

Posted Apr 24, 2008 22:49 UTC (Thu) by hummassa (subscriber, #307) [Link]

Never had any of the forementioned problems. Sure, you could have 
put "invoke-rc.d autofs restart" in a file inside 
your /etc/network/if-up.d/ and voila, but apparently it's too arcane. 
Maybe I'm getting old. I have three laptops, one dekstop and an AppleTV 
all running kde-network-manager (some stuck at home network, some roaming 
wildly) and it's pretty much plug-and-play for me.

I am appalled.

Posted Apr 24, 2008 23:35 UTC (Thu) by madscientist (subscriber, #16861) [Link]

As I said, it's enterprise environments where it fails.  Sure, simple home users with a cable
or DSL modem serving DHCP, or connecting to your local Starbucks wifi or whatever, have no
problems: everyone uses that model and of course it works properly.

It's when you start needing lots of OTHER network services, like NIS, autofs, etc. etc. that
we hit the "there be dragons" areas where Ubuntu has not done the due diligence to make sure
their super-cool new features don't break traditional, long-standing, it-just-works
facilities.

BTW, adding a script to if-up.d won't work: the problem is not that autofs starts before the
network interface comes up: autofs actually doesn't need the network interface to be up IIRC.
The problem is that autofs starts before NIS binds to its server, so when autofs starts and
asks NIS for its maps, NIS doesn't give it any maps, so autofs doesn't set up any automounts.
What needs to happen is autofs cannot start until AFTER NIS has finished binding to its server.

I don't know of any way to do that in the current Ubuntu LTS release, short of creating some
script that runs in the background and queries NIS to see when it has maps available, then
(re-)starts autofs when it is.

The Grumpy Editor encounters the Hardy Heron

Posted Apr 29, 2008 11:50 UTC (Tue) by broonie (subscriber, #7078) [Link]

FWIW the "someone" who hacked this into NIS was that SuSE developer who is the Linux NIS
upstream. It actually works pretty well when Network Manager reports accurate information but
unfortunately Network Manager seems to have lots of trouble with that on some systems.

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds