GOTCHA in Ubuntu - broken shell

Bill Sconce sconce at in-spec-inc.com
Fri Sep 28 20:29:58 EDT 2007


On Fri, 28 Sep 2007 15:31:13 -0400
Sarunas <sarunas at mail.saabnet.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> Bill Sconce wrote:
> > Hi, all -
> > You may know this: Ubuntu's default shell isn't bash.
> 
> Only partially true. Installer/dpkg asks you whether you want dash 
> (i.e./bin/sh -> /bin/dash symlink).


Yike. This makes it worse.

I don't remember answering any such question. And I've done dozens
of Ubuntu installs. And I see nothing about an install-time option
in the otherwise lengthy thread about this bug report at
   https://bugs.launchpad.net/ubuntu/+source/dash/+bug/61463
.

But sure enough, if I type at a root prompt:
  dpkg-reconfigure dash
up comes a CURSES window:

      Ubuntu Configuration

       --------------------| Configuring dash |--------------------
      |                                                            |
      |  Bash is the default /bin/sh on a Debian system. However,  |
      |  since our policy requires that all shell scripts using    |
      |  /bin/sh to be POSIX compliant, any shell that conforms    |
      |  to POSIX can serve as /bin/sh. Since dash is POSIX        |
      |  compliant, it can be used as /bin/sh. You may wish to do  |
      |  this because dash is faster and smaller than bash.        |
      |                                                            |
      |  Install dash as /bin/sh?                                  |
      |                                                            |
      |                   <Yes>             <No>                   |
      |                   ^^^^^                                    |
       ------------------------------------------------------------

It has to be possible that I saw this at install time.  (Although
the default clearly IS dash.)

What makes it worse:

  o Now the user's been made complicit in causing the problem
  
  o The "you may wish...faster and smaller" is a clear recommendation
  
  o The "since our policy" may take care of THEIR scripts, but it
    leaves users exposed to every bash script ever written, both 
    their own and every bash script supplied by every third party,
    including hosts of packages in upstream standard Debian.
    
Arrogant. Unbelievable. The side effects were reported during beta
and still the developers did this.

Nevertheless, thanks, Sarunas. Presumably I "asked" for this
trouble when I installed Ubuntu; even if I don't remember clicking
"Yes" it's almost certain that I would have. I would have read that
as promising that dash was compatible with bash, only smaller and
faster. Who wouldn't?  (Who here didn't?  :)

ON THE OTHER HAND: Even now, a year later, typing as root 
"dpkg-reconfigure dash" and selecting <No>

                   * * UNDOES THE DAMAGE * *  !!

I just did so. Now /bin/sh -> /bin/bash !

And my scripts work again.

This is a WHOLE lot better than having to find and change hundreds
of script headers. (Which would only have taken care of my own
scripts in any case.  And not the next script in some downloaded
package.)

And just now I'm wondering: how many of the obscure "./configure |
make | make install" problems I've encountered have been due to dash?
EVERY "make" problem is obscure... having a broken /bin/sh can only
make things more difficult.)

Fixed.  Hurrah!  Now all we have to do is remember that we "may
wish to do this" NOT!! in future Ubuntu installs...

Thanks again, Sarunas!  Brilliant catch.

-Bill

P.S. I recommend reading that entire launchpad thread -- it's like
reading Microsoft's opinions of THEIR users' troubles...


More information about the gnhlug-discuss mailing list