aboutsummaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
authorKurt J. Bosch <kjb-temp-2009@alpenjodel.de>2011-07-03 21:13:50 +0200
committerKurt J. Bosch <kjb-temp-2009@alpenjodel.de>2011-07-10 18:10:31 +0200
commit328e15f698f4c280d61bfce1f27bf21c1a7f057d (patch)
treef28b6586434dd20e4ee3e38573daaf973a04891f /rc.sysinit
parentd1f4307c2e7fb56a6f699bf2bfaa3e67197c46ef (diff)
downloadinitscripts-328e15f698f4c280d61bfce1f27bf21c1a7f057d.tar.xz
functions/rc.sysinit: Refactor fsck-redirection to prevent breakage
$FSCK_OUT/$FSCK_ERR might not be set when: * unset in some custom sysinit_prefsck hook * calling fsck() from a shutdown hook
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-xrc.sysinit6
1 files changed, 3 insertions, 3 deletions
diff --git a/rc.sysinit b/rc.sysinit
index f64c9ad..5814007 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -174,8 +174,8 @@ if [[ -f /etc/crypttab && $CS ]] && grep -q ^[^#] /etc/crypttab; then
fi
# Check filesystems
-FSCK_OUT=/dev/stdout
-FSCK_ERR=/dev/stdout
+FSCK_OUT=
+FSCK_ERR=
FSCK_FD=
FORCEFSCK=
[[ -f /forcefsck ]] || is_in_array forcefsck $(< /proc/cmdline) && FORCEFSCK="-- -f"
@@ -183,7 +183,7 @@ declare -r FORCEFSCK
run_hook sysinit_prefsck
if [[ -x $(type -P fsck) ]]; then
stat_busy "Checking Filesystems"
- fsck_all
+ fsck_all >|${FSCK_OUT:-/dev/stdout} 2>|${FSCK_ERR:-/dev/stdout}
declare -r fsckret=$?
(( fsckret <= 1 )) && stat_done || stat_fail
else