fsck should ignore SIGQUIT. Some implementation exit code 3 for a reboot. Reboot on Linux requires the -f flag.
This commit is contained in:
parent
148739ed99
commit
c1b3aa77a9
26
init.d/fsck
26
init.d/fsck
@ -12,25 +12,29 @@ depend()
|
|||||||
|
|
||||||
start()
|
start()
|
||||||
{
|
{
|
||||||
|
local reboot_opts= fsck_opts=
|
||||||
|
|
||||||
if [ "${RC_UNAME}" = "Linux" ]; then
|
if [ "${RC_UNAME}" = "Linux" ]; then
|
||||||
opts="${opts} -A -C0 -T"
|
fsck_opts="-A -C0 -T"
|
||||||
if echo 2>/dev/null >/.test.$$; then
|
if echo 2>/dev/null >/.test.$$; then
|
||||||
rm -f /.test.$$
|
rm -f /.test.$$
|
||||||
opts="${opts} -R"
|
fsck_opts="${fsck_opts} -R"
|
||||||
fi
|
fi
|
||||||
|
reboot_opts="-f"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ebegin "Checking local filesystems"
|
ebegin "Checking local filesystems"
|
||||||
fsck ${fsck_args--p} ${opts}
|
trap : QUIT
|
||||||
|
fsck ${fsck_args--p} ${fsck_opts}
|
||||||
case $? in
|
case $? in
|
||||||
0) eend 0; return 0;;
|
0) eend 0; return 0;;
|
||||||
1) ewend 1 "Filesystems repaired"; return 0;;
|
1) ewend 1 "Filesystems repaired"; return 0;;
|
||||||
2|4) ewend 1 "Filesystems repaired, but reboot needed"
|
2|3|4) ewend 1 "Filesystems repaired, but reboot needed"
|
||||||
reboot; exec rc-abort; return 1;;
|
reboot ${reboot_opts}; exec rc-abort; return 1;;
|
||||||
8) ewend 1 "Operational error"; return 0;;
|
8) ewend 1 "Operational error"; return 0;;
|
||||||
12) ewend 1 "fsck interupted"; return 1;;
|
12) ewend 1 "fsck interupted"; return 1;;
|
||||||
*) eend 2 "Filesystems couldn't be fixed"
|
*) eend 2 "Filesystems couldn't be fixed"
|
||||||
exec rc-abort; return 1;;
|
exec rc-abort; return 1;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user