|author||David Bright <dab@FreeBSD.org>||2018-01-15 19:25:11 +0000|
|committer||David Bright <dab@FreeBSD.org>||2018-01-15 19:25:11 +0000|
Exit fsck_ffs with non-zero status when file system is not repaired.
When the fsck_ffs program cannot fully repair a file system, it will output the message PLEASE RERUN FSCK. However, it does not exit with a non-zero status in this case (contradicting the man page claim that it "exits with 0 on success, and >0 if an error occurs." The fsck rc-script (when running "fsck -y") tests the status from fsck (which passes along the exit status from fsck_ffs) and issues a "stop_boot" if the status fails. However, this is not effective since fsck_ffs can return zero even on (some) errors. Effectively, it is left to a later step in the boot process when the file systems are mounted to detect the still-unclean file system and stop the boot. This change modifies fsck_ffs so that when it cannot fully repair the file system and issues the PLEASE RERUN FSCK message it also exits with a non-zero status. While here, the fsck_ffs man page has also been updated to document the failing exit status codes used by fsck_ffs. Previously, only exit status 7 was documented. Some of these exit statuses are tested for in the fsck rc-script, so they are clearly depended upon and deserve documentation. Reviewed by: mckusick, vangyzen, jilles (manpages) MFC after: 1 week Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D13862
Notes: svn path=/head/; revision=328013
Diffstat (limited to 'sbin/fsck_ffs/fsck_ffs.8')
1 files changed, 36 insertions, 4 deletions
diff --git a/sbin/fsck_ffs/fsck_ffs.8 b/sbin/fsck_ffs/fsck_ffs.8
index 0d29a9aebd5a..a1b2cdda70a3 100644
@@ -29,7 +29,7 @@
.\" @(#)fsck.8 8.4 (Berkeley) 5/9/95
-.Dd February 14, 2017
+.Dd January 13, 2018
.Dt FSCK_FFS 8
@@ -376,11 +376,43 @@ contains default list of file systems to check.
.Sh EXIT STATUS
-If the option
+Specific non-zero exit status values used are:
+.Bl -tag -width indent
+Usage error (missing or invalid command arguments).
+option was used and a
+was received, indicating that the system should be returned to single
+user mode after the file system check.
+The file system superblock cannot be read.
+This could indicate that the file system device does not exist or is not yet
+A mounted file system was modified; the system should be rebooted.
+option was used and soft updates are not enabled on the file system.
+option was used and the kernel lacks needed support.
+option was used and the file system is clean.
+General error exit.
+The file system could not be completely repaired.
+The file system may be able to be repaired by running
-exits 7 if the file system is clean.
+on the file system again.
The diagnostics produced by