Can't spawn jobs without /dev/null breaks mountall-dev which would create it; aka mountall: Event failed

Bug #513919 reported by Loïc Minier
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
mountall (Ubuntu)
Fix Released
Medium
Unassigned
upstart (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Binary package hint: upstart

Hi

While trying to boot with a 2.6.30 kernel, I discovered that the system can't boot with /dev on tmpfs instead of devtmpfs.

The system starts with some useful devices in /dev, then upstart spawns mountall which mounts /dev as tmpfs (no devtmpfs available), then emits the mounted even with MOUNTPOINT=/dev TYPE=tmpfs. When upstart tries starting mounted-dev (which is "start on mounted /dev"), it fails to do so because there is no /dev/null.

Just creating /dev/null before emitting this event is enough to fix the problem (no other device is needed).

(This is despite mounted-dev.conf NOT using console output.)

I will probably move to 2.6.32 or backport devtmpfs support in my kernel, but another workaround to demonstrate the underlying problem is to change mountall.conf as follows:
#expect daemon
[...]

script
    . /etc/default/rcS
    [ -f /forcefsck ] && force_fsck="--force-fsck"
    [ "$FSCKFIX" = "yes" ] && fsck_fix="--fsck-fix"

    #exec mountall --daemon $force_fsck $fsck_fix
    mountall --verbose --no-events $force_fsck $fsck_fix
    mknod /dev/null char 1 3
    initctl emit --no-wait mounted MOUNTPOINT=/dev TYPE=tmpfs
    initctl emit --no-wait mounted MOUNTPOINT=/var/run TYPE=tmpfs
    initctl emit --no-wait mounted MOUNTPOINT=/tmp
    initctl emit --no-wait virtual-filesystems
    initctl emit --no-wait local-filesystems
    initctl emit --no-wait filesystem
    echo "sent all events"
end script

This boots fine.

Thanks,

ProblemType: Bug
Architecture: amd64
Date: Thu Jan 28 19:33:56 2010
DistroRelease: Ubuntu 10.04
Package: upstart 0.6.3-11build1
ProcEnviron:
 LANGUAGE=fr_FR.UTF-8
 PATH=(custom, user)
 LANG=fr_FR.UTF-8
 SHELL=/bin/zsh
ProcVersionSignature: Ubuntu 2.6.32-11.15-generic
SourcePackage: upstart
Uname: Linux 2.6.32-11-generic x86_64

Related branches

Revision history for this message
Loïc Minier (lool) wrote :
Revision history for this message
Loïc Minier (lool) wrote :

BTW during my toying MAKEDEV-ing random stuff, I got upstart to fail with:
init: system.c:119: Unhandled error from system_setup_console: No such file or directory
init: Failed to spawn mounted-dev main process: unable to open console: No such file or directory
despite /dev/console existing. I suspect /dev/null or stdin didn't exist (this was after MAKEDEV console, but I'm not sure whether I had console output in this particular test).

Revision history for this message
Loïc Minier (lool) wrote :

Proposed workaround: fork + run "mknod /dev/null 1 3" in mountall.

Revision history for this message
Loïc Minier (lool) wrote :

Err or just mknod() of course ;-)

Revision history for this message
Loïc Minier (lool) wrote :

Much simpler workaround for people trying to fix their boot: comment out /dev in /lib/init/fstab.

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Can't decide whether this is a mountall bug (that it should ensure /dev/console and /dev/null exist after mounting /dev as a special case), or an Upstart bug for requiring /dev/null (but I'm not sure what to set the stdin/out/err fds to if that doesn't exist)

Changed in upstart (Ubuntu):
status: New → Triaged
Changed in mountall (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Changed in upstart (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Loïc Minier (lool) wrote :

Perhaps you could create pipes to upstart, or have a flag to have no stdin/stdout/err and use that with mounted-dev.conf?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mountall - 2.5

---------------
mountall (2.5) lucid; urgency=low

  * conf/mounted-dev.conf:
    - Go back to copying from /lib/udev/devices, this is much faster for
      the devtmpfs case since almost all devices will already exist.
      LP: #507162.
  * src/mountall.c:
    - If we mount something new over /dev, we need to make /dev/console and
      /dev/null again as otherwise the whole system falls apart (even init).
      LP: #513919.
 -- Scott James Remnant <email address hidden> Wed, 17 Feb 2010 11:56:41 +0000

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.