Category Archives: All things Unix

Why We Don’t Use Windows (if we can avoid it) #537

Some software vendors haven’t caught on yet, and still make applications that run under Windows only.  Unfortunately for us, some of those apps are “must have,” so we still have to have at least one working copy of Windows around.  Our current one is a refurbed off-lease IBM desktop we picked up a few years ago, running XP.  It’s been up and running lately, but doesn’t do much other than installing so-called security updates from time to time.

We had left it alone for a couple of weeks while busy with other projects.  Today,  I tickled it a bit to wake it up, and, when the “select user” screen appeared, clicked on my username.  The machine whirred a bit, then promptly announced I was being logged out.  OK, idiosyncratic behavior sometimes happens, so I try again.  Same thing.  Different user, same thing.  Hmm.  Maybe something got corrupted, boot to Safe Mode.  Same thing…  Can’t logon, even as administrator (it’s XP Home, so, no difference, really).  Oh-oh.  We did have some fairly important stuff on this machine.  Not good.

So, off to the Web on one of our trusty Linux boxes, symptoms indicate the C:\\WINDOWS\system32\userinit.exe file is, what?  Missing?  How can that happen?  This is a vital system file in the middle of one of the most holy of holies in the whole operating system.  But, I rummage through my files and drag out the Ubuntu 9.10 CD I used to upgrade my laptop a couple weeks ago (which had it’s own issues with wireless drivers, but nothing like casually losing an essential file after running for three or four years).

I boot the “live CD” version of Ubuntu 9.10, mount the Windows partition, and, sure enough, no userinit.exe file.  Everything else seems to be there, so I boot up a newly-installed  XP virtual machine running under VirtualBox on our 64-bit Linux box–to which I was planning to migrate our Windows “have to” apps.  I upload the missing file to my Linux account using pscp.exe, then pull it over to the broken XP installation with scp, using the live-CD session.   Next, reboot to Windows XP, and voila! it comes up normally.

Going back over the long tech forum trail, I find that this is a not-uncommon event with XP, and, if you only have Windows to work with, is painful if not nearly impossible to recover from, usually involving extracting the file from an OEM CD.  We do have one (which is where our Virtual-Box installation came from), but it was much easier to do the deed by booting Linux.  Besides, taking the file from a running XP installation ensures it is the latest version–there is always that issue when restoring from the original CD.  Windows doesn’t have packages with dependency checking like Linux and other Unix-like systems do, so it would be easy to get out-of-spec by doing that.

Next, we did some more detective work to see why something like this would happen in the first place.  Now, there isn’t a smoking gun, because these forums are run by and frequented by folks who think that Windows is the only way to compute, and that whatever it does is “normal,” so nobody thinks it is strange that this fatal bug is actually a Stupid Microsoft Trick, used in a feeble attempt to emulate Unix’ system single-user-mode and ‘NOLOGIN’ environment settings, when installing system updates.  It appears that the Windows Updater actually modifies the registry under certain circumstances to perform this trick, and may replace the userinit.exe file.  After all, have you ever wondered how the system does the reboot thing during an update and bypasses the logon entirely?  If you are so unlucky as to try to logon to your machine during this time or–because the automated process may not go quite as smoothly due to network glitches, power events, or whatever–after the update has failed to complete correctly, you are now permanently in zero-user mode, and the file is just plain gone.

Sorry, Microsoft, a lot of us think this is just not the way to run a computer operating system.  Our preferred system architecture is well-thought-out, handles multiple security levels, multiple users, multitasking, and has done so nearly flawlessly for about 40 years, during which time it just gets better.  Yours has been built from a 16-bit port of an 8-bit microprocessor program loader that has been an endless series of compromises and risks to beat the clock and can’t get any better unless the legacy crutches are abandoned once and for all.  No matter how fine you try to close the gap on a race condition, it is still a race condition, and sooner or later, deadlocks happen.  A patched kludge is still a kludge.

Meanwhile, while working on the fix, we quietly backed up the entire hard drive onto one of the Linux servers. so our data is safe.  Now, if we could only persuade the software providers to write their applications in solid code for operating systems it could actually work on safely, and we wouldn’t have to endure these kinds of torments.

Caveat–this worked for me as written, but you might have to modify more files in the system32 directory to get the machine to boot so you can fix the Registry if the logon value for the executable file has been changed.  In my case, the userinit.exe file was just missing, the Registry seems to be normal.  No malicious malware suspected, just a missing file that gets unsafely manipulated by updates–on purpose.

Back to Business — sort of

Arrived back in Washington in time to take care of serial sick grandkids, in between looking at mysterious freeze-ups in a client’s HPC cluster (nothing new–it has been an issue through several OS upgrades, an elusive will-o-the-wisp that has existed since $CLIENT == $WORK -> TRUE) and exploring new Linux tools.  New to me, anyway.  Fired up GKrellm, the Linux performance monitor.  Looks much like the old perfmeter tool that has been in Solaris since the OpenWindows days.

Beginning to settle in and get comfortable with Ubuntu 9.10, which has lots of subtle improvements over 8.10, which we’ve used since late 2008. Judy’s workstation is still at 9.04, as I haven’t had time to work out some upgrade issues that need tweaking on the upgrade. Hers is 64-bit, so there are some other issues there, too. We recently upgraded the HP-Compaq C714NR laptop to 2GB of RAM, which really makes a difference in performance, but not quite ready to brave the 64-bit issue with all the wireless issues we’ve had over the years. The Gnome Network Manager is nearly flawless, and gets us on wireless networks painlessly, at least since we resolved the cantankerous Broadcom 4311 driver problems.  Best of all, if it detects a strong network you already have configured, it simply and automatically connects. We still have a bit of a kludge in the wireless driver arena, as we first let the b43 driver load, get the usual “you must update your firmware” message, then run a startup script to unload b43 and load the Broadcom driver, after which all is well. Hmm, time to go look at the firmware issue, as long as we don’t have a road trip planned for almost a month.  I did install b43-fwcutter and fiddle with this earlier, but without much success.  Sometimes us old hardware hackers just need a system that works, to get on with the revenue-producing work, that  doesn’t involve endless tweaking of drivers and firmware.

Ubuntu Karmic Koala update looking better

After a week of upgrade woes getting our Broadcomm wireless chip to work with Karmic Koala, the effort seems to be worthwhile, especially since discovering the builtin Gnome Network Manager applet.  We’re sitting at Zaxan Cafe at The Mill  in Hamilton, and the wireless connection was a painless click-click.  Last time we were here, running Intrepid Ibex (8.10), lots of fiddling required in the old network manager, etc.  We tried WiFi-Radar, but it comes with Some Assembly Required, Batteries Not Included: the Gnome applet just plain works.

Linux, and particularly Ubuntu, is becoming a mainstream end-user system, slowly but surely.  Unix has always been an “expert friendly system,” and the need for professional system administration services (and some of us have had our own issues with lack of documentation) has kept it out of the “even Grandma can use it” mode.   We’re using Google Chrome, which is evolving, but the extensions are almost essential to business-oriented social networking and cloud computing.  Firefox is the solid browser, and Opera is attractive.

Curiouser and Curiouser — Wifi at last?

OK, another mystery.  I added the patch from the CD, added DKMS from the CD, added the bcmwl-kernel-source package, which crashed the system.  Backed out the bcmwl-kernel package.  Then, recompiled the STA driver downloaded from Broadcom, cleaned up the /etc/init.d/wifi.sh script, dropped and reloaded the newly compiled wl module, restarted networking, and voila! , the blue light blinks red and blue and the wireless interface is now working.  But, wifi-radar still can’t connect.

Browsing around for a different approach, I find that Ubuntu 9.10 comes with the latest and greatest version of Gnome Network Manager.  Hey, maybe that’s what that little antenna symbol in the top toolbar is…  Click, I can see the network offered; click, and I’m connected!  Whoof.  Almost an entire week since we started this upgrade, and five days of fighting with drivers and configurations, and we are back mobile-prepared again, just hours  before starting on our week-long road trip.  Now, if it will only survive a reboot…

Your mileage may vary (Linux tips)

The battle for wireless connectivity continues.  The mystery of the system crashes is at least revealed, if not understood.  A blog by Alvonsius indicated there is a package on the Karmic Koala install disk that will enable Broadcom adapters:  bcmwl-kernel-source.   I had installed it (from web archives, not the disk) on Saturday, which instigated the video lockups (go figure!). Last night, I rediscovered this helpful hint and applied it, upon which the system crashed a few minutes after logging in.

OK, back to single-user (recovery) mode, remove the offending package, and reboot.  The system is once more stable.  Now, the next step is to remove the driver obtained directly from Broadcom and the scripts that load it, and try again with the Ubuntu package.  Now, the other day, when the crashing and burning started, it was some time after unsuccessfully trying the bcmwl package on an updated system, so the fix was not quite so obvious.

Meanwhile, I am getting a lot of flack from other members of the household about choosing to use a “one-off” system like Linux.  Now, these are professional people, but not computer people.  Like most of the world, they don’t seem to understand that a computer system isn’t just a single machine, but a system representing an entire population of generations of software writers, so its behavior is just as unpredictable in specific instances as that of an unruly crowd.  The world of Microsoft and Windows is more or less totalitarian, so that users’ actions are restricted and the shortcomings of the system are hidden behind barriers of state secrecy.  In the Open Systems world, there is a lot more freedom, but there also isn’t always a cop around when you need one.  But, then, you do have the option to take matters into your own hands and deal with the problem.  Which is OK if you have the tools and knowledge it takes.  On the other hand, in the world of proprietary software, the danger is much like that in totalitarian societies: if you are being beaten and robbed, it is no use calling the police–they are already there.