aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-02-01 10:48:21 +0000
committerRoy Marples <roy@marples.name>2008-02-01 10:48:21 +0000
commitc1b3aa77a9aed69005d386d2ce44d6b224a142e3 (patch)
treef4334f34f456b848cc7c81dc5f0fbd4aa3124df5
parent148739ed995876402301e37b512d79c6cb3a2fbe (diff)
fsck should ignore SIGQUIT. Some implementation exit code 3 for a reboot. Reboot on Linux requires the -f flag.
-rw-r--r--init.d/fsck26
1 files changed, 15 insertions, 11 deletions
diff --git a/init.d/fsck b/init.d/fsck
index d4aa0a7c..3ee3b38b 100644
--- a/init.d/fsck
+++ b/init.d/fsck
@@ -12,25 +12,29 @@ depend()
start()
{
+ local reboot_opts= fsck_opts=
+
if [ "${RC_UNAME}" = "Linux" ]; then
- opts="${opts} -A -C0 -T"
+ fsck_opts="-A -C0 -T"
if echo 2>/dev/null >/.test.$$; then
rm -f /.test.$$
- opts="${opts} -R"
+ fsck_opts="${fsck_opts} -R"
fi
+ reboot_opts="-f"
fi
ebegin "Checking local filesystems"
- fsck ${fsck_args--p} ${opts}
+ trap : QUIT
+ fsck ${fsck_args--p} ${fsck_opts}
case $? in
- 0) eend 0; return 0;;
- 1) ewend 1 "Filesystems repaired"; return 0;;
- 2|4) ewend 1 "Filesystems repaired, but reboot needed"
- reboot; exec rc-abort; return 1;;
- 8) ewend 1 "Operational error"; return 0;;
- 12) ewend 1 "fsck interupted"; return 1;;
- *) eend 2 "Filesystems couldn't be fixed"
- exec rc-abort; return 1;;
+ 0) eend 0; return 0;;
+ 1) ewend 1 "Filesystems repaired"; return 0;;
+ 2|3|4) ewend 1 "Filesystems repaired, but reboot needed"
+ reboot ${reboot_opts}; exec rc-abort; return 1;;
+ 8) ewend 1 "Operational error"; return 0;;
+ 12) ewend 1 "fsck interupted"; return 1;;
+ *) eend 2 "Filesystems couldn't be fixed"
+ exec rc-abort; return 1;;
esac
}