Chad Perrin: SOB

6 September 2009

Making Ubuntu Boot to Text Console

Filed under: Geek — apotheon @ 02:16

A little less than a year ago, I wrote a script for my SigO (as a Christmas gift) that loads a random background image when she starts X with IceWM. In the process of migrating to a new laptop, though, she found that vanilla Debian wasn’t working as well as she would like. The specific problem was that wireless wouldn’t work unless she used a newer kernel and the ATI driver wouldn’t work unless she used an older kernel — which meant she would have to choose between wireless networking and playing World of Warcraft. Neither option was appealing. There were some other problems, too — involving Wine not working under certain circumstances — but I don’t recall the specifics. Maybe I’m misremembering the situation, but it was all something like that.

As a result, the new laptop ended up with Ubuntu running on it. Of course, being the discerning person with excellent taste that she is, she finds GNOME highly annoying. As such, she futzed around until she got IceWM working and decided she would just live with a crapload of unnecessary and undesirable GNOME garbage living on the hard drive since uninstalling any of it would result in a bunch of other stuff she actually wants and isn’t necessarily GNOME-specific being hosed up (aren’t Ubuntu dependencies grand?). Unfortunately, because the random background script I wrote was called from .xinitrc, and neither of us knew off the tops of our heads how to do something similar with gdm, we either needed to learn how (if possible) to get gdm to do what .xinitrc used to do when using startx to start X, or we had to get gdm to stop working.

I haven’t dealt with this kind of thing on any Linux systems in a while, so it took me a few minutes of farting around to remember about the rcN.d directories in /etc. Once I got to that point, though, I entered runlevel at the shell to find out that her laptop automatically boots to runlevel 2. Armed with this information, I checked out the contents of /etc/rc2.d and found S30gdm (S for “start”). Great! I just renamed that to K30gdm (K for “kill”), and figured that should solve the problem. Now she could boot to a text console instead of straight into a display manager, and use startx with .xinitrc to get her random backgrounds. She, like me, seems to like having the option of just running the system at the console when no GUI is needed, anyway.

While I was at this, she asked me to turn off the splash screen, and looked up the /boot/grub/menu.lst syntax to disable the splash screen and get console output during bootup so I wouldn’t have to strain my brain trying to remember that sort of thing about how the bootloader works.

Everything was great after that point, except one thing: now, the system would hang on reboot. Shutdown would work fine when going to runlevel 0, but reboot when going to runlevel 6 would cause it to hang at the point where it tells the user that it’s going to restart the system.

We both did some hunting through Google’s archive of the Internet, but we didn’t find anything worthwhile. She did more of that than me, because I was spending the time searching through the /etc/init.d scripts and so on. Eventually, I recalling enough about how Debian-based Linux systems work to crawl through the filesystem looking for problems that led to a solution. It turns out that the /etc/init.d/reboot script restarted the system by executing reboot -d -f -i. This is where it gets really interesting.

It turns out that reboot -d -f -i would work fine on FreeBSD, with the -d option (according to the manpage) doing the following:

 The system is requested to create a crash dump.  This option is
 supported only when rebooting, and it has no effect unless a dump
 device has previously been specified with dumpon(8).

. . . but the version of the halt script that Ubuntu’s /etc/init.d/reboot uses doesn’t have a -d option listed in its manpage at all. I decided to try removing the -d option from the reboot command in /etc/init.d/reboot and see what changed. It fixed the problem; now the system restarts just fine. I don’t know how it was executing a reboot when gdm was still running that was so different from how it did things after I disabled gdm at runlevel 2, but at least we got it working without having to have gdm acting as gatekeeper to system functionality any longer.

Trouble In Paradise

Okay — what the fuck?

Why does deactivating gdm cause the graphics driver to stop working properly so that 3D rendering doesn’t work any longer?

Christ on a stick, I hate the way Ubuntu just assumes that everybody wants to do everything exactly one way, and no other way of doing this is “okay”. Yes, we must all want GNOME, and gdm, and a fucking splash screen at start up, and seventy metric tons of other useless shit cluttering up our computers and getting in our fucking way. We all want it so badly that turning any of that off has to break fucking everything.

Goddammit, Ubuntu, you can pucker up and kiss my bunghole. Shit.

4 Comments

  1. Everything I have read/heard about Ubuntu has convinced me that it isn’t Linux/*Nix in the spirit of those OS’s. It is (at a spiritual level) Windows with a different kernel and open source. I may be way off base or incorrect, but nothing about Ubuntu is attractive to me, it seems to combine the worst of Window’s heavy handedness with the worst of *Nix quirkiness (as your post lays out in excrutiating detail).

    J.Ja

    Comment by Justin James — 6 September 2009 @ 07:39

  2. Earlier today, the comment I made to the SigO about this disaster was:

    The difference between Ubuntu and MS Windows appears to be that with Windows, you don’t get to change anything about how the system works, and it can fail on you at any time without warning; with Ubuntu, you don’t get to change anything about how the system works because if you do, chances are good it will fail on you in surprising ways.

    At least Ubuntu will be stable, as long as you don’t actually do anything with it (including upgrading the kernel). Then again, I seem to be getting about that level of stability out of my MS Windows test (and game) system: as long as I don’t do anything with it, it seems reasonably stable. It just does weird things every now and then, like randomly slow down in the middle of some mundane task — and, as much as I loathe GNOME, it’s at least marginally more to my taste than Explorer, since it supports stuff like multiple workspaces.

    That’s a pathetically small margin of improvement, though. These days, every time I have to work with some Linux distribution — even briefly — it’s painful by comparison with the substantially more deterministic stability of FreeBSD, pretty much no matter what kind of weirdness I impose on its configuration.

    Comment by apotheon — 6 September 2009 @ 08:46

  3. My Vista systems (yes, the maligned Vista…) has survived me doing a huge amount of weird things on it up until a few months ago, and it was installed when Vista RTMed nearly 3 years ago. That’s a pretty darned good run, IMHO. So far, the only things wrong is Flash not wanting to remain detectable post reboot (this is a known Flash problem), Windows Media Player requiring “Run as Administrator” to actually run, and Visual Studio being cranky (which I beleive is because I recently uninstalled Visual Studio 2005).

    My FreeBSD server is rock solid… but I also don’t do anything with it. It just sits there spitting out a dozen Web request a day, acting as my SMTP server (only so I can send large attachments), receiving a few hundred spam messages a day, and acting as a backup destination. I hate to say it, but out of the 3 or 4 incarnations of this server, this is the first one that I got to not be fairly mangled. In large part that was my fault, and some of it was qmail’s fault. I keep asking myself why I tolerate that application, and I can never find a good reason. The author has the huge chip on his shoulder about “the way things should be” and likes to impose it on everyone else instead of playing nice with their OS. Things like insisting on an alternate file structure and putting things in non-standard locations.

    I keep wanting to try FreeBSD as a desktop OS, but my experiences have been awful with it, for the most part. I tried PC-BSD multiple times, but each time I do, I stare at the screen and my first thought is, “how do I import the 10 GB of Outlook PST files that I have, and all of my RSS feeds I have Outlook setup to handle?” Don’t ask me about the times I’ve tried to set up KDE or GNOME… it’s a consistently frustrating experience, to say the least. The one time I got it mostly working right, the system refused to remember the screen resolution settings, what a pain in the neck!

    I also have this other little problem with a *Nix switch… my writing at TechRepublic. For better or for worse, while I try my best to report on as much non-.NET stuff as I can, I think it is fairly safe to say that .NET is the only area which I currently have enough experience in to write authoritatively and (more importantly, accurately) on. The realities of TechRepublic needs are, of course, that P&D needs to be primarily about .NET or Java to justify it… Ruby, Python, Scala, Scheme… all of the stuff that interests me is all fairly nice stuff, and I find the Java world even more repellent than .NET (odd dichotomy… I think that the “fringe Java” stuff is more interesting than “fringe .NET”, but “mainstream .NET” appeals to me more than “mainstream Java”). To make a long story short (too late, Brad), a huge part of me wants to make this leap of faith to a non-Microsoft platform (perhaps Mac?), and re-learn programming from the ground up in a liberated environment, free of the .NET shackles (is my mind too warped by the .NET gamma rays to handle it?). The other part of me recognizes that it would be the end of my writing career. No way could I immerse myself in a full reinvention of my skills as a programmer and still do the writing… I just don’t have that kind of time for both. And for better or for worse, I really need that writing check lately, to finish paying down the debt from last year and gear up for a house purchase in the next 2 years.

    I’ve come to realize how little control I have in my life, and how my existence so infrequently is for the benefit of myself. In this particular instance, my family’s needs for certain things (a good school district in a few years for my son, the car my wife needed, etc.) have created a need for income which both demolishes my free time (the writing itself doesn’t take long, but I spend 1 – 2 hours a night staying on top of the industry) and my ability to take risks (like going .NET-less for a while).

    I (finally) started a project that I had been meaning to do for about 3 years now. I started Friday afternoon, and other than some look/feel stuff (icons in particular), there is only one major issue which prevents me from having it in a state where I could derive income from it in a week. That’s not bad for a weekend’s worth of labor. I’ve had this idea in my head forever now, and it feels good to finally get it done and see where I can take it. Maybe it can generate the revenue I need to get “over the hump” and get some freedom back in my life. :)

    J.Ja

    Comment by Justin James — 6 September 2009 @ 09:22

  4. Visual Studio being cranky (which I beleive is because I recently uninstalled Visual Studio 2005)

    I thought that would be because VS is inherently cranky.

    I keep wanting to try FreeBSD as a desktop OS, but my experiences have been awful with it, for the most part.

    The triumvirate of core BSD Unix flavors, as they roll out of the “factory”, are definitely not for the faint of heart. They’re like vi that way, with a learning curve a bit like an 800 foot sheer cliff, but definitely worth it once you get to the top.

    how do I import the 10 GB of Outlook PST files that I have, and all of my RSS feeds I have Outlook setup to handle?

    I’m not a big fan of vendor lock-in. I avoid that stuff like the plague.

    Don’t ask me about the times I’ve tried to set up KDE or GNOME. . . it’s a consistently frustrating experience, to say the least.

    As you may have guessed, I’m not a fan of KDE and GNOME, either.

    For better or for worse, while I try my best to report on as much non-.NET stuff as I can, I think it is fairly safe to say that .NET is the only area which I currently have enough experience in to write authoritatively and (more importantly, accurately) on.

    I can definitely understand that. I have a crazy idea, though, that you might want to consider:

    What about trying out some writing about Mono? It might offer you a stepping-stone to other subjects, and you can even start small with references to portability concerns for code written to work both on MS .NET and Mono installs. It may not actually work as such a stepping-stone, depending on a number of factors including pure blind luck in how your life guides you, but it might be worth considering at least.

    You don’t have to be authoritative about everything about which you write, after all. As long as you can speak authoritatively and accurately about something, you can branch out into closely related areas and discuss them from the point of view of someone who knows your area of core competency. It is, in fact, similar in concept to writing a review of a newly acquired tool, or even a new version of an old, familiar tool — such as a new Visual Studio release.

    I’ve come to realize how little control I have in my life, and how my existence so infrequently is for the benefit of myself.

    I know you have a lot of demands on your time that many others (in particular, those who don’t have families other than the people who spawned them in the first place) don’t have. It’s rough. I certainly don’t blame you for sticking with what you know for the most part. In fact, I kinda feel for you, because of the lack of freedom to pursue pretty much any interest that flits through your head. Short of being able to afford the pursuit of new interests, that’s not so much a problem I have, and sometimes I lose sight of how lucky I am in that respect.

    Of course, having kids is reputed to be very rewarding as well, and well worth the trade-off. I probably just don’t know what I’m missing.

    Comment by apotheon — 6 September 2009 @ 10:19

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

All original content Copyright Chad Perrin: Distributed under the terms of the Open Works License