0.3: upstart utterly fails when /bin/sh symlink disappears

Bug #65024 reported by Paul Sladen on 2006-10-10
Affects Status Importance Assigned to Milestone
upstart (Ubuntu)

Bug Description

upstart does not even allow a sulogin or reboot to work if '/bin/sh' is missing.

Ideally upstart should have a list of other known likely interactive shells on the system and at least give the user a chance to untangle their system.

The principal problem here is that /bin/sh is hardcoded as something to use in job_run_* -- we should check for exec failing and have some kind of fallback.

Perhaps just exec'ing /sbin/sulogin directly is appropriate?

Changed in upstart:
status: Unconfirmed → Rejected
assignee: nobody → keybuk
importance: Undecided → Low
status: Unconfirmed → Confirmed
Changed in upstart:
assignee: nobody → keybuk
importance: Undecided → Low
status: Rejected → Confirmed
Erdal Ronahi (erdalronahi) wrote :

I am being hit hard by this. After playing around with gconf, I cannot boot anymore. The initial output showed that /bin/sh cannot be executed. I booted with a Live CD and corrected the symlink for /bin/sh, which linked to dash. After linking it to bash, I still have the following output:

/etc/rcS.d/S20checkroot.sh: line 353: /lig/init/readlink: Permission denied
/etc/lsb-base-logging.sh: line 37: /sbin/usplash_write: Permission denied
* Cannot initiatlize /etc/mtab.
/etc/rcS.d/S20checkroot.sh: line 389: /bin/rm: Permission denied
init: Unable to execute "/bin/sh" for rc-default: Permission denied
init: rc-default process (3285) terminated with status 1

Any workarounds for this?

Erdal Ronahi (erdalronahi) wrote :

Seems to have been a wrong entry in fstab that caused the problem - is solved for me.

Changed in upstart:
assignee: keybuk → nobody
assignee: keybuk → nobody

Rejecting the Ubuntu portion of this bug, since the dependency on a working /bin/sh is internal to the upstart code and not a by-product of the Ubuntu rules.

Changed in upstart:
status: Confirmed → Rejected

Depends on having feedback of whether exec(), etc. failed; once we have that, if exec() of /bin/sh fails, we can execute some appropriate fallback.

I'm going to suggest something like /sbin/sulogin --missing-shell as a standard "OMG! THE SKY IS FALLING!" escape route. Of course, if your sulogin is missing, or is written in shell, you're still screwed.

Changed in upstart:
status: Confirmed → Triaged

Trunk now has better handling of failures in the child process whilst still inside Upstart's own code, specifically it can catch an exec() failure and obtain the error number.

In practice, there's little we can realisitically do; but we do at least log the problem ("No such file or directory") and fail both the job and event that spawned it.

This means that a distribution can deal with /bin/sh missingness with any of:

  start on stopped sulogin failed
  exec /sbin/omgtheskyisfalling


  start on stalled/failed
  exec /sbin/omgtheskyisfalling


Changed in upstart:
status: Triaged → Fix Committed
Changed in upstart:
status: Fix Committed → Fix Released

Still affects Ubuntu

Changed in upstart:
status: Invalid → Triaged
summary: - upstart utterly fails when /bin/sh symlink disappears
+ 0.3: upstart utterly fails when /bin/sh symlink disappears

Preparing packages of Upstart 0.6.0 for karmic

Changed in upstart (Ubuntu):
status: Triaged → In Progress
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package upstart - 0.6.0-1

upstart (0.6.0-1) karmic; urgency=low

  * New upstream release ("How appropriate, you fight like a cow")
    - my customary changes list since pointless, it's basically a
      complete rewrite.
    - Handles /bin/sh symlink disappearing. LP: #65024.
    - Boot parameters may be passed to init scripts. LP: #74664.
    - reboot implies --force during shutdown. LP: #388738.
    - reboot no longer iterates /proc/ide. LP: #92685.
    - much improved documentation. LP: #60429, #72058, #388715.

  * Merge the various upstart packages into a single package, it makes
    little sense to have it all spread out.

 -- Scott James Remnant <email address hidden> Wed, 08 Jul 2009 23:12:03 +0100

Changed in upstart (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers