LionsPhil ([info]lionsphil) wrote,

Ubuntu Edgy: the wrong priorities

[info]fragglet has already posted about this, but given that I pointed him to the bug, and given that it's being NOTABUG'd by the wonders of Open Source, I'm going to see if I can spread it around just a little more. Come on, blogosphere---do your Web 2.0 thing. (Hey, new pictures of kittens on flickr! Cool!)

/bin/sh in Ubuntu Edgy Eft does not give you GNU Bash. In theory, this is perfectly acceptable—/bin/sh is only guaranteed to be some POSIX-compatable shell. In reality, however, Linux® users expect GNU Bash, and this means that there are myriad shell scripts out there which incorrectly assume either that #!/bin/sh will get them Bash, or that they're only using POSIX features when they've actually accidentally slipped in a Bash-ism. (Oh, wouldn't it have been nice of Bash to only allow sh features when run as sh. Alas, too late.)

The bugs are in the scripts. I don't debate this. The problem is, this change (to dash, if you're wondering) has caused things to break. It's amazing how little users care to any real depth about whose fault it is when something they're trying to get done breaks. (Suspend is completely shafted on my laptop at the moment. I could be the ACPI module; it could be the kernel itself; it could be some GNOME power management thing; it could be some other module not cleanly stopping/resuming, or getting the hardware in a pickle—I don't care. I don't have the time or knowledge of that area of the system to investigate properly. I just want it to work, and it doesn't, so I swear at Ubuntu as a whole under my breath and deal with having to shut down every time I put my laptop in my bag.) Things that work in Dapper, Fedora, Gentoo and so on will not in Edgy, and people will blame Ubuntu. They are not unreasonable to do so, because their lives are too short to learn what shells are, let alone about the differences between them. They just wanted to install something manually, or follow some instructions on a wiki, or any of the myriad things that people follow by rote (a search for "dash" in Edgy's bug list used to provide several examples, but they seem to have shunted them off as dash bugs, which is even more hilariously wrong), and they're getting all these errors in the bit with the terminal.

(Hell, even if you're a veritable UN*X-head, you're still potentially screwed the first time. You won't get any clear indication that you're using dash until/unless you think to look at where /bin/sh actually points. Shell scripts just start throwing errors (or worse, if it's a semantic, not syntactic, Bash/Dash difference), and it's up to your investigative powers to either work out of find out that it's due to incorrect expectations of bash/self-POSIX-ness.)

The bottom line is that this decision, for the sake of pedantry and a tiny speed increase (seriously, if the overhead of Bash over Dash is making you lose sleep, you may want to leave the wonderfully baroque world of shell scripting entirely, and replace the damn things with real programmes), has made Ubuntu Edgy randomly break some things for some people. For a distro which has had such a strong Just Work™ approach to stuff, why is this the right thing for it to be doing? I'd expect this from, I don't know, Gentoo. (Using a copy of dash compiled at -O11, of course. And they'd change it to some other shell the week after, ad infinitum.)

Right. So. It's the Wrong Thing™. It's been causing bugs, and there's even a meta-bug–type-thing (61463) in Launchpad. What do the Ubuntu developers do?

Close the bug as a rejected wishlist item, because there are "no plans to change the default [shell] back to bash".

This is the path of beaurocracy and standards-pedantry over actual usefulness to the human beings which Ubuntu proclaims to be for. Am I getting excessively worked up over a shell? Not particularly: I'm getting disturbed by the whiff of a trend in this direction, and it doesn't exactly reassure me to hear that Debian developers—bastions of idealism over a system you can actually use—have been jumping project to Ubuntu. If you smell that too, kick up a stink.

Update: There are some other good arguments being added to the bug report—notably, this:

I initially reported [scripts using /bin/sh when they meant /bin/bash] to Debian in 1997...I was blown off and told that /bin/sh would always be /bin/bash and that people could and should just assume that /bin/sh was not merely a POSIX sh but provided all the extra bashisms.
–Justus Pendleton (Emphasis mine)
Tags: computersarebroken, linux, rant

  • Post a new comment

    Error

    Comments allowed for friends only

    Anonymous comments are disabled in this journal

    Your reply will be screened

    Your IP address will be recorded 

  • 8 comments

[info]mcnutcase

November 30 2006, 11:20:30 UTC 5 years ago

Attempt number *FIVE*...

Anyway. I begin to see why you've ordered yon Mac, and I wish I had the money to do similar even with my conviction that Apple did entirely the Wrong Thing in changing from PowerPC (yes, x86 can be made fast. It's like a 911 though - I don't care WHAT fucking miracles you've performed on it, the engine is still IN THE WRONG PLACE, and anyone sane would have it NOT HANGING OFF THE ARSE!)

Ahem.

Anyway. I was considering Edgy, because despite their "LTS" bullshit, Ubuntu have COMPLETELY fucking dropped Dapper now that Edgy is here, but since it Randomly Breaks Stuff for the sake of "I'm better than you" rather than simply because the maintainer's a fucktard (vide xchat on Ubuntu) it can go forth, multiply and expire in words of one syllable.

And you may be glad to know that OSX's default shell is bash, not tcsh as it used to be...

Anonymous

November 30 2006, 21:40:31 UTC 5 years ago

Re: Attempt number *FIVE*...

Clearly the solution here is to start a new distribution. You'll need a third-rate artist to replace the iconset and design custom splash screens. You'll need a new startup and shutdown theme tune. And a catchy name, all distros need that. How about Lionux? That should do nicely.

[info]lionsphil

November 30 2006, 21:50:45 UTC 5 years ago

Don't forget the motto!

You've got to have something you claim to stand for, so that you can make decisions which go completely against it in a later version.

[info]mcnutcase

December 1 2006, 07:22:44 UTC 5 years ago

Re: Don't forget the motto!

Ubuntu score twice there, with the dash thing AND "long-term support".

[info]broonie

October 25 2007, 23:44:25 UTC 4 years ago

The quote there is rather out of date with regard to the situation in Debian - there's actually been an ongoing effort for a while now to support the use of an alternate /bin/sh (including fixing portability bugs - this has facilitated Ubuntu's switch). There are enough people who benefit from the optimisation

One thing to bear in mind here is that you don't want to end up in the situation Solaris is where almost everyone curses the serious issues in the default system configuration but due to the strong compatibility guarantees they offer back to SunOS days Sun find it impossible to improve the situation. Some customer system may be relying on a bug or misfeature but over the long term it becomes far too noticable. To make matters worse the nature of software is such that customers who need this still have to do extensive QA on upgrades to make sure that all the bugs they need are still present.

For Ubuntu in this situation I would expect that the overwhelming majority of their users are using software packaged for Ubuntu (either distributed by Ubuntu or otherwise) and that a substantial proportion of them are going to see the benefits that changing away from bash brings. The wins from things like startup time are visible, particularly within a heavily optimised boot sequence, and benefit a wide range of users many of whom would not know what a shell script is. Most of the users who will be negatively affected are people who have written their own shell scripts; they will be much more able to cope with a change like this than most desktop users would be able to even know what a shell is.

[info]lionsphil

October 26 2007, 00:00:15 UTC 4 years ago

Damnit. I just lost my reply in piece of browser hatefulness. (Backspace being "go back" when textbox not focused: hate. Something about LiveJournal blanking the form when going forward again: hate.)

Anyway, yes, the quote's ten years out of date, I admit, and I'm glad to hear that it's no longer true. (/bin/sh == GNU bash assumptions are wrong.)

But this oft-cited advantage of boot times could have been achieved without the costs in other ways. Change the shebang on the init scripts to explicitly use dash. Create a separate symlink for boot scripts---say, /bin/init-sh---which points to dash. Don't go changing what make et. al. use.

Especially as you now have a default config where /bin/sh's echo builtin (that of Dash) differs in behaviour from /bin/echo (that of GNU coreutils' echo). And from the login shell, GNU bash. That's just hateful.

[info]broonie

October 28 2007, 15:11:44 UTC 4 years ago

There's really no other maintainable approach to this. Remember that almost everything in Ubuntu is maintained as a patch against something elsewhere - changing all the sh scripts to be dash scripts would require maintaining a very large mechanical diff and would only benefit things that were provided by the distro.

Also note that it's not just boot time that benefits from this. There are a number of tasks that often end up legitimately spawning a lot of shells so it's not just a case of going through the subset of scripts that get run during boot.

[info]grendelkhan

June 8 2009, 19:05:46 UTC 2 years ago

For completeness' sake.

Justus Pendleton, at best, was a bit forgetful about what the folks on debian-devel told him. As Peter Tobias replied,
If special bash features are used the files should use "#!/bin/bash" instead of "#!/bin/sh".
Or as Heiko Schlittermann put it:
Probably it should be suggested/recommended/enforced, that every bash-ism using script starts with ``#! /bin/bash'' rather then with ``#! /bin/sh''
While he was told that /bin/sh would always be /bin/bash, there was no consensus that the scripts shouldn't be made semantically correct, especially since it would make any migration to another shell (unthinkable at the time) much easier.

No, this doesn't make Ubuntu's decision any less boneheaded. But it does mean that Pendleton's claim is a bit overblown.
Create an Account
Forgot your login or password?
Facebook Twitter More login options
English • Español • Deutsch • Русский…