Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 28178 - checkfs script seems to think error code 1 indicates a serious error
Summary: checkfs script seems to think error code 1 indicates a serious error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-08 04:28 UTC by Arve Knudsen
Modified: 2003-11-23 04:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arve Knudsen 2003-09-08 04:28:03 UTC
Whenever fsck.jfs returns an error code of 1 (no idea why it doesn't return 0, 
since it seems alright), /etc/init.d/checkfs seems to think a serious error has 
occurred.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.



Expected Results:  
While the fsck manual seems to indicate error codes 4 and upwards are critical, 
/etc/init.d/checkfs in it's current incarnation includes 1 among these numbers. 
That is, numbers *greater than* 1 and less than 4 are non-critical. Shouldn't it 
be *greater than or equal to* 1?
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2003-09-11 08:13:18 UTC
This is fixed in .10 already, please try baselayout-1.8.6.10-r1:


------------------ checkfs -------------------------
<--snip-->
                if [ "${retval}" -eq 0 ]
                then
                        eend 0
                elif [ "${retval}" -gt 1 -a "${retval}" -lt 4 ]
                then
                        ewend 1 "Filesystem errors corrected."
                        # Everything should be ok, so return a pass
                        return 0
                else
                        eend 2 "Fsck could not correct all errors, manual repair needed"
                        /sbin/sulogin ${CONSOLE}
                fi
<--snip-->
Comment 2 Arve Knudsen 2003-09-11 09:18:31 UTC
I am using .10-r1 (latest and greatest(?)). Shouldn't "elif [ "${retval}" -gt 1 -a "${retval}" -lt 4 ]" be replaced with elif [ "${retval}" -ge 1 -a "${retval}" -lt 4 ]"? That is, '-ge' seems like the correct option to me. At least it fixed the problem I had (whats the '-a' option for btw, can't find it consulting man test).
Comment 3 toon 2003-11-23 04:51:47 UTC
Right, is's still wrong.  :-)

I'm running with baselayout-1.8.6.10-r1, and checkfs contains the following code:

if [ "${retval}" -eq 0 ]
then
        eend 0
elif [ "${retval}" -gt 1 -a "${retval}" -lt 4 ]
then
        ewend 1 "Filesystem errors corrected."
        # Everything should be ok, so return a pass
        return 0
else
        eend 2 "Fsck could not correct all errors, manual repair needed"
        /sbin/sulogin ${CONSOLE}
fi

Return value 1 is obviously missed in the 'elif' clause, which is wrong.
Please correct it. It costed me an unnecessary trip to the data center already.

Regards,
Toon.