Monday, October 22, 2007

Ubuntu and Avahi

More from the 'why Ubuntu sucks' front.

Wireless networking has been extremely questionable on this laptop. Sure, the driver works, and if the NIC ever gets around to being configured via DHCP, everything is fine. For awhile.

I first got the wifi up and running with knetworkmanager running under fluxbox. This seemed to work, even though you have to type in the network password every time (kwallet gets started, supposedly to save the password for you, but aside from prompting you for the wallet password I've yet to see this do anything useful).

The problem arose when I moved to e17. No system tray, so no knetworkmanager. Aside from demonstrating a design flaw in the NetworkManager package (only GNOME and KDE systray applets, no Gtk, Qt, or CLI applications), this didn't seem to be too much a problem; just write a shell script that does the ol' "ifdown; iwconfig; ifup" right?

Wrong. The interface can be configured this way, sure, but that has no effect on actually bringing the interface up. The DHCP times out with no response. I started a second Xsession running fluxbox and ran knetworkmanager, without connecting to the network, and went back to e17. At some point in the next half hour (I stopped checking after the first10 minutes), the interface got configured, and the wifi worked fine. I closed knetworkmanager and fluxbox and got some work done, went to sleep, woke up and found the wireless interface has unconfigured itself.

Got bit angry at that; it's a special case of a cardinal UNIX rule: choice of window manager and running applications should not effect the network connectivity of the machine. We're getting into Windows and OS X territory here; Ubuntu is no longer UNIX. Ubuntu is starting to stink of crap.

To wrap things up, I tracked the problem down to Avahi (specifically, avahi-autoipd) and removed it, as I don't have discoverable devices on my wireless network anyways (what fool does?):
bash > sudo apt-get remove avahi-autoipd avahi-daemon
...
The following packages will be REMOVED:
avahi-autoipd avahi-daemon kdenetwork kdnssd libnss-mdns
I restarted debus, hald, networking (after modifying /etc/defaults/avahi-daemon), and all that ... no dice. Against my better judgement, I rebooted.

After rebooting, my ifdown/iwconfig/ifup script worked just fine. Welcome to Windows, guys!

I'm really starting to wonder why I should stick with Ubuntu over plain Debian. I'm not using their version of KDE or GNOME, since I prefer e17. I had to build a custom kernel for my laptop hardware, and Ubuntu does not allow this (you cannot reconfigure their kernel source package and expect it to compile, something they stubbornly refuse to admit is a 'bug'). I guess the ability to install AVI-viewing software without any pain is useful, though that's really a fault of Debian than a feature of Ubuntu.

For the curious, here is the shell function I use for starting a second X session:

alt_wm () {
if [ -z "$1" ]
then
echo Usage: alt_wm path [screen]
return 1
fi

SCREEN_NUM=$2
[ -z "$SCREEN_NUM" ] && SCREEN_NUM="1"

xinit $1 -- :${SCREEN_NUM}
}

4 comments:

  1. Ubuntu is more based for the casual newbie, imho. I started with redhat way bak when, and eventually tried ubuntu, but I realized that alot of the apeal in it was that stuff just worked, sure you have to do a bit of work for some hardware, but for the most part everything was supported, unless you have the newest of the new non-linux driver/ development driver hardware.

    Right now I am on Gentoo, and I must say that it really is the best for some, that like to know what is being installed, You might apreciate it because theres no squiggling around removing the default behavior, I mean you really do build your system to you liking, including only what you want and nothing more.

    Granted the compiletime sometimes sucks, but hey thats what sleep is for, leave it compiling and nod away..

    but I think your racking on ubuntu really doesnt fit, If your a more advanced user, try usig something more advanced, and less conglomorated. Go modular.. :)

    cheers

    ReplyDelete
  2. Well, that's the problem right?

    I *wanted* Ubuntu to "just work", so I could installed it on the new laptop, do a code checkout, and get back to productivity.

    Not only did Ubuntu not *just work*, it interfered with the 'power user' ways of getting past stuff not working (specifically, iwconfig) -- which means it is the worst of all possible worlds.

    Things seem to be going well after the gutsy update, a custom kernel compile, and the installation of the Gos E17 packages.

    ReplyDelete
  3. Not only does Ubuntu often not "just work," but it's silly to say that a non-newbie should go to a different distro. The original poster sounds like an experienced Unix person, and I've been using Unix and Linux for over 20 years, and I've been using Ubuntu because I have actual work to do, and don't want to waste time playing sys admin.

    But as Ubuntu evolves away from basic Unix philosophies, and less-and-less "just works," I'm more motivated to yet again look for a better distribution.

    As Henry Spencer said, "Those who fail to understand UNIX are doomed to reimplement it. Poorly." I've seen little evidence that the Ubuntu folks understand Unix.

    ReplyDelete
  4. Ubuntu's appeal is that it "just works", but only if you don't screw with it too much. While you have the ability to strip out and replace the desktop and other things, you're starting to get into the "advanced linux user" area that Ubuntu is trying to shy away from. While you're saying "Ubuntu is stinking of Windows", in an ironic way you're right. Ubuntu wants to be user/noob-friendly, and configurable in the "pick your paint job" fashion. However, more advanced users think that this also means it's highly-configurable in the advanced sense (IE: swapping out actual car parts, adding performance parts to the engine, etc). This is going a bit beyond what core Ubuntu is all about, which is why other Ubuntu-derivatives have spun-off (just as Ubuntu spun-off of Debian).

    I'm not saying that's good or bad, it's just how it is. Ubuntu is really meant for the "complete Linux noob". When you start getting into Linux more, using things like e17 or such, you'll probably be happier experimenting with another distro of Linux where you have more control, like Arch or Slax. Ubuntu has a tons of under-the-hood scripts and things that let it all work as a pre-packaged solution. While they're pretty robust, they can start getting hosed up with you rock the boat too much.

    My biggest issue with Linux in general is getting wireless USB adapters to work with older hardware on a WPA-encrypted network. Seems Ubuntu works pretty good with WPA & Network Manager. But I'm trying to resurrect an old 200mhz machine with 128mb ram. To do so, I switched over to DSL (Damn Small Linux). Unfortunately, most popular, lite linux distros like DSL don't have pre-canned WPA support, even though WPA has been the de-factor standard for a while now (I thought we all moved past WEP, unless you like getting hacked).

    So, I sort of reversed this by installed Xubuntu onto the drive for the 200mhz, and start stripping the hell out of it, leaving only the bare minimal to use JWM, Dillo, etc. However, I still had Avahi, Hal, etc going, since a lot of that stuff was needed for Network Manager. After reading your post, though, I realize I could probably strip out Avahi and save me some more RAM. I found I could get rid of the GNOME network manager (which has a nice nm-applet to handle the network hookup, and even JWM shows it in the icon tray, so it really makes me wonder why e17 can't). I replaced it with Wifi-Radar which is good and works in GUI.

    I really just wish lite Linux distros, the kind targeted to old hardware, would wake up and recognize that some folks are going to use USB wireless with WPA. Guess I could try Puppy Linux.

    ReplyDelete