/etc/init.d/checkfs and checkroot do not handle the return value of 32 from fsck correctly. That is when fsck scans some partitions, finds errors and corrects them and the system should reboot after the scan. In the script it does not, instead the user is given a single user prompt. This harms automation of gentoo linux and is just plain wrong. Reproducible: Always Steps to Reproduce: 1. run checkfs or checkroot from /etc/init.d 2. some how get fsck to return 32 within the scripts 3. and behold the single user prompt. Actual Results: Got a single user prompt and not a rebooting system. Expected Results: reboot the system. I made a couple patches the corrected this problem. --- checkfs 2003-09-02 20:11:53.000000000 +0000 +++ /etc/init.d/checkfs 2003-08-24 14:51:57.000000000 +0000 @@ -134,6 +134,14 @@ ewend 1 "Filesystem errors corrected." #everything should be ok, so return a pass return 0 + elif [ "${retval}" -eq 2 ] + then + einfo "Rebooting" + /sbin/reboot -f + elif [ "${retval}" -eq 32 ] + then + einfo "Fsck Canceled by user" + eend 0 else eend 2 "Fsck could not correct all errors, manual repair needed" /sbin/sulogin ${CONSOLE} --- checkroot 2003-09-02 20:11:59.000000000 +0000 +++ /etc/init.d/checkroot 2003-08-24 14:57:09.000000000 +0000 @@ -34,6 +34,14 @@ elif [ "${retval}" -eq 1 ] then ewend 1 "Filesystem repaired" + elif [ "${retval}" -eq 1 ] + then + einfo "Rebooting" + /sbin/reboot -f + elif [ "${retval}" -eq 32 ] + then + einfo "Fsck Canceled by user" + eend 0 else eend 2 "Filesystem couldn't be fixed :(" /sbin/sulogin ${CONSOLE}
I terribly sorry. I ment return value 2 not 32. Also these patches shown do not work correctly. Please use the following patches instead. --- /etc/init.d/checkfs 2003-09-02 16:28:44.000000000 +0000 +++ checkfs 2003-09-02 20:11:53.000000000 +0000 @@ -134,13 +134,6 @@ ewend 1 "Filesystem errors corrected." #everything should be ok, so return a pass return 0 - elif [ "${retval}" -eq 2 ] - then - einfo "Reboot needed." - einfo "Unmounting filesystems" - /bin/mount -a -o remount,ro &>/dev/null - einfo "Rebooting" - /sbin/reboot -f else eend 2 "Fsck could not correct all errors, manual repair needed" /sbin/sulogin ${CONSOLE} --- /etc/init.d/checkroot 2003-09-02 16:05:33.000000000 +0000 +++ checkroot 2003-09-02 20:11:59.000000000 +0000 @@ -35,11 +35,8 @@ then ewend 1 "Filesystem repaired" else - if [ "${retval}" -gt 2 ] - then - eend 2 "Filesystem couldn't be fixed :(" - /sbin/sulogin ${CONSOLE} - fi + eend 2 "Filesystem couldn't be fixed :(" + /sbin/sulogin ${CONSOLE} einfo "Unmounting filesystems" /bin/mount -a -o remount,ro &>/dev/null einfo "Rebooting"
Hi, update to .10 of baselayout which have this already fixed.
Already fixed.