[Pkg-sysvinit-devel] Bug#341097: initscripts: Double output of
"Done checking root file system" in checkroot.sh during bootup
Alexej Sveshnikov
svesh at seznam.cz
Mon Nov 28 11:47:26 UTC 2005
Package: initscripts
Version: 2.86.ds1-6
Severity: minor
During bootup the checkroot.sh produces the following output:
Will now check root filesystem.
<result of the check>
Done checking root file system
* Done checking root file system
This is caused by a typo in the script, where construction 'if [condition] action1 then action2 fi'
is used instead of 'if [condition] ; then action1 else action2 fi'. Additionaly, the FSCKCODE should be
set to $? before this 'if' sentence and immediately after the fsck command. Currently it is set to $? after
the output of 'Done checking root file system' message and represents in fact the result of 'echo' command,
which is always zero. Thus, the subsequent tests of FSCKCODE variable do not perform the correct action.
The patch to the checkroot.sh script follows:
@@ -249,12 +249,12 @@ exec 9>&0 </etc/fstab
fi
log_action_msg "Will now check root file system"
fsck $spinner $force $fix -T -t $roottype $rootdev
- if [ "$?" = 0 ]
+ FSCKCODE=$?
+ if [ "$FSCKCODE" = 0 ] ; then
log_success_msg "Done checking root file system"
- then
+ else
log_failure_msg "Done checking root file system"
fi
- FSCKCODE=$?
fi
#
More information about the Pkg-sysvinit-devel
mailing list