dashism in checkroot/checkfs/usplash functions

Bug #575154 reported by Thorsten Glaser
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sysvinit (Ubuntu)
Invalid
Undecided
Unassigned
Nominated for Hardy by Thorsten Glaser

Bug Description

Binary package hint: sysvinit

When trying to run Hardy with mksh as /bin/sh booting fails. I now managed to track it down
to a bug in initscripts still present in maverick:
https://launchpad.net/ubuntu/+archive/primary/+files/sysvinit_2.87dsf-4ubuntu17.dsc

Let me illustrate the actual problem:

tglase@tglase:~ $ mksh -c 'sleep 2 & sleep 1; wait %1; echo $?'
0
tglase@tglase:~ $ mksh -c 'sleep 1 & sleep 2; wait %1; echo $?'
127
tglase@tglase:~ $ dash -c 'sleep 1 & sleep 2; wait %1; echo $?'
0
tglase@tglase:~ $ bash -c 'sleep 1 & sleep 2; wait %1; echo $?'
bash: line 0: wait: %1: no such job
127

Basically, the “wait” builtin returns 127 if the job has already finished by the time
wait is called, except in dash, where it returns 0. This makes *buntu unusable
with a shell other than dash as /bin/sh (among other things). I also wonder
whether this is the cause (with not using mksh as /bin/sh though) for our
workstations (at work) to boot to multiuser with / in read-only mode even
when it wants the 30-mount check (we need to manually fsck and reboot
then, which is idiotic in a production / company environment).

I’m currently working on a fix, will attach that soonish.

Revision history for this message
Thorsten Glaser (mirabilos) wrote :

OK, got it. Both of them, I think. There was actually junk at the end of the e2fsck output file:

+ PASS=1
+ CUR=327
+ MAX=2316 /dev/sda1

This gave an expr arithmetic error.

Revision history for this message
Thorsten Glaser (mirabilos) wrote :

OK, here it is. Tested on hardy, with both dash and mksh (39.3-3) as /bin/sh of course.
Maybe some e2fsprogs upgrade changed the format…

Revision history for this message
Thorsten Glaser (mirabilos) wrote :

Hrm. Looking at the sysvinit_2.87dsf-4ubuntu17.dsc I see that…
• someone already fixed the e2fsprogs/read bug, but forgot the “local”
• checkfs/checkroot are no longer part of the package?!

So, no patch for Maverick from me for now… sorry.

Revision history for this message
Adam Guthrie (therigu) wrote :

Does this mean this is fixed in Maverick then?

Revision history for this message
Thorsten Glaser (mirabilos) wrote :

No, it means I cannot find the checkroot.sh script in maverick… do you know where it’s been moved?

Revision history for this message
Adam Guthrie (therigu) wrote :

Looks like they've been removed:

sysvinit (2.87dsf-4ubuntu3) karmic; urgency=low

  FFE LP: #427356.

  * Various initscripts have been replaced by Upstart jobs shipped in
    other packages, the following have been removed:
    - hostname.sh
    - mountkernfs.sh
    - mountdevsubfs.sh
    - checkroot.sh
    - mtab.sh
    - checkfs.sh
    - mountall.sh
    - mountall-bootclean.sh
    - mountoverflowtmp
    - mountnfs.sh
    - mountnfs-bootclean.sh
    - bootmisc.sh
    - bootlogs
    - rmnlogin

 -- Scott James Remnant <email address hidden> Tue, 15 Sep 2009 02:45:59 +0100

Revision history for this message
Thorsten Glaser (mirabilos) wrote :

OK, thanks. Then I suppose it’s nonexistent there.

Revision history for this message
Steve Langasek (vorlon) wrote :

as noted, this bug no longer exists in Ubuntu.

Changed in sysvinit (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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