[Pkg-sysvinit-devel] Bug#342744: checkroot.sh sources mountvirtfs,
yet attemps to supply arguments
Tore Anderson
tore at debian.org
Sat Dec 10 01:13:07 UTC 2005
Package: initscripts
Version: 2.86.ds1-6
Tags: patch
/etc/init.d/checroot.sh does the following at line 338:
. /etc/init.d/mountvirtfs start
This breaks if the script is interpreted by /bin/dash, as its "."
builtin ignores any arguments after the filename to source. Because $1
is undefined, mountvirtfs will proceed to print a usage summary to
stderr (and $0 is still set to "checkroot.sh" - that had me confused
for a while), before calling "exit". This will abort the execution of
the checkroot.sh script entirely, making the "rm -f /dev/shm/root" call
below never reached.
Trivial patch attached.
I didn't see any breakage from this apart from the error message
during boot. Is it really necessary to call mountvirtfs from
checkroot.sh? It seems to be called from init directly as well (twice,
even), so everything gets mounted in the end. (Just curious.)
Kind regards
--
Tore Anderson
-------------- next part --------------
--- /tmp/etc/init.d/checkroot.sh 2005-11-19 12:40:50.000000000 +0100
+++ /etc/init.d/checkroot.sh 2005-12-10 02:06:55.000000000 +0100
@@ -335,7 +335,7 @@
[ "$roottype" != none ] &&
mount -f -o $rootopts -t $roottype $fstabroot /
[ -n "$devfs" ] && mount -f $devfs
- . /etc/init.d/mountvirtfs start
+ /etc/init.d/mountvirtfs start
fi
#
More information about the Pkg-sysvinit-devel
mailing list