Package: initscripts
Version: 2.86.ds1-4
Severity: normal
Tags: patch
Hello,
thanks for packaging initscripts.
With the recent grep problem I had to perform some stages of boot by
hand, and I've noticed that mountvirtfs is very silent about its
problems:
- It would succeed if called with no parameters:
$ /etc/init.d/mountvirtfs && echo yes
yes
- It would succeed if called with wrong parameters:
$ /etc/init.d/mountvirtfs garble && echo yes
yes
- It would even succeed if called with the correct parameters, but by
non-root:
$ /etc/init.d/mountvirtfs start && echo yes
yes
A patch follows that improves reporting on bad commandline options:
--------------------------------------------------------------------
--- mountvirtfs 2005-11-12 12:28:48.351425320 +0100
+++ mountvirtfs.enrico 2005-11-12 12:30:47.041381704 +0100
@@ -240,9 +240,13 @@
}
case "$1" in
- start)
+ start|restart|reload|force-reload)
do_start
;;
+ stop)
+ ;;
*)
+ echo "Usage: $0 start|stop|restart|reload|force-reload"
+ exit 0
;;
esac
--------------------------------------------------------------------
The following patch instead prints some notice on stderr when
mountvirtfs in not in the condition of doing what one would expect:
--------------------------------------------------------------------
--- mountvirtfs.enrico 2005-11-12 12:30:47.041381704 +0100
+++ mountvirtfs.enrico.errors 2005-11-12 12:43:22.308563640 +0100
@@ -56,6 +56,7 @@
# Directory present ?
if [ ! -d $3 ]
then
+ echo "Mount point $3 is not present: skipping it." >&2
return
fi
@@ -83,6 +84,12 @@
fi
if [ "$TYPE" = "" ]
then
+ if [ "$2" -ne "" ]
+ then
+ echo "Filesystem type $1 is not supported: skipping
mounting of $3." >&2
+ else
+ echo "Neither filesystem type $1 nor $2 are supported:
skipping mounting of $3." >&2
+ fi
return
fi
@@ -121,7 +128,10 @@
if ! mountpoint -q $3
then
# No, do it now
- mount $MOUNT_N -t $TYPE $OPTS $4 $TYPE $3
+ if [ ! mount $MOUNT_N -t $TYPE $OPTS $4 $TYPE $3 ]
+ then
+ echo "Mount failed for $3: skipping it." >&2
+ fi
else
# Need to update mtab only ?
if [ -n "$DO_MTAB" ] &&
--------------------------------------------------------------------
Bye,
Enrico
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-1-686
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Versions of packages initscripts depends on:
ii coreutils 5.2.1-2.1 The GNU core utilities
ii dpkg 1.13.11.0.1 package maintenance system for Deb
ii e2fsprogs 1.38-2 ext2 file system utilities and lib
ii libc6 2.3.5-7 GNU C Library: Shared libraries an
ii lsb-base 3.0-11 Linux Standard Base 3.0 init scrip
ii util-linux 2.12p-8 Miscellaneous system utilities
initscripts recommends no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]