'Twas brillig, and Kay Sievers at 13/03/13 11:50 did gyre and gimble:
> On Wed, Mar 13, 2013 at 11:29 AM, Colin Guthrie <gm...@colin.guthr.ie> wrote:
>> As I'm doing some initrd-less experiments of late I'm seeing an ugly
>> fsck message pop up on boot.
>>
>> In systemd-fsck-root.service I see:
>>
>> StandardOutput=journal+console
>>
>> which results in:
>>
>> systemd-fsck[116]: /dev/sda2: clean, 435608/1310720 files,
>> 3375994/5242112 blocks
>>
>> being output over the top of plymouth screen (and actually persists over
>> the initial gdm screen when it fades in).
>>
>> While I do get the point of showing this on the console, is there a way
>> we can make it silent in the "clean" case?
>>
>> Would this be something we'd need push down to all the fsck
>> implementations (i.e. support a -q argument or look for "silent" on
>> /proc/cmdline) or can we add some kind of fugly heuristic to the
>> systemd-fsck that silently swallows the output if it consists of a
>> single line which has the string ": clean," and there is "silent" on the
>> command line?
> 
> It should be patched into the fsck tool, not to print "clean" or any
> other messages at all, when all is fine.
> 
> I only think the ext stuff does that nonsense; just switch to btrfs. :)

One day, but I'm still paranoid for now!

FWIW, the attached patch seems to work for me, but I'm not sure it'll be
accepted upstream... The change is smaller than it looks, it just wraps
the log output in an if statement that suppresses the message when -a is
supplied.

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/
Author: Colin Guthrie <co...@mageia.org>

When the filesystem is clean, e2fsck still prints out a "clean" message
when checking. This can muddy the boot and leak into plymouth/gdm on
silent boots.

This patch simply does not show the clean message when the -a option
is passed to the fsck.

--- e2fsprogs-1.42.7/e2fsck/unix.c.0002	2013-01-22 03:33:35.000000000 +0000
+++ e2fsprogs-1.42.7/e2fsck/unix.c	2013-03-13 13:16:52.254482074 +0000
@@ -421,33 +421,35 @@
 	}
 
 	/* Print the summary message when we're skipping a full check */
-	log_out(ctx, _("%s: clean, %u/%u files, %llu/%llu blocks"),
-		ctx->device_name,
-		fs->super->s_inodes_count - fs->super->s_free_inodes_count,
-		fs->super->s_inodes_count,
-		ext2fs_blocks_count(fs->super) -
-		ext2fs_free_blocks_count(fs->super),
-		ext2fs_blocks_count(fs->super));
-	next_check = 100000;
-	if (fs->super->s_max_mnt_count > 0) {
-		next_check = fs->super->s_max_mnt_count - fs->super->s_mnt_count;
-		if (next_check <= 0)
+	if (!(ctx->options & E2F_OPT_PREEN)) {
+		log_out(ctx, _("%s: clean, %u/%u files, %llu/%llu blocks"),
+			ctx->device_name,
+			fs->super->s_inodes_count - fs->super->s_free_inodes_count,
+			fs->super->s_inodes_count,
+			ext2fs_blocks_count(fs->super) -
+			ext2fs_free_blocks_count(fs->super),
+			ext2fs_blocks_count(fs->super));
+		next_check = 100000;
+		if (fs->super->s_max_mnt_count > 0) {
+			next_check = fs->super->s_max_mnt_count - fs->super->s_mnt_count;
+			if (next_check <= 0)
+				next_check = 1;
+		}
+		if (!broken_system_clock && fs->super->s_checkinterval &&
+		    ((ctx->now - fs->super->s_lastcheck) >= fs->super->s_checkinterval))
 			next_check = 1;
+		if (next_check <= 5) {
+			if (next_check == 1) {
+				if (batt)
+					log_out(ctx, _(" (check deferred; "
+						       "on battery)"));
+				else
+					log_out(ctx, _(" (check after next mount)"));
+			} else
+				log_out(ctx, _(" (check in %ld mounts)"), next_check);
+		}
+		log_out(ctx, "\n");
 	}
-	if (!broken_system_clock && fs->super->s_checkinterval &&
-	    ((ctx->now - fs->super->s_lastcheck) >= fs->super->s_checkinterval))
-		next_check = 1;
-	if (next_check <= 5) {
-		if (next_check == 1) {
-			if (batt)
-				log_out(ctx, _(" (check deferred; "
-					       "on battery)"));
-			else
-				log_out(ctx, _(" (check after next mount)"));
-		} else
-			log_out(ctx, _(" (check in %ld mounts)"), next_check);
-	}
-	log_out(ctx, "\n");
 skip:
 	ext2fs_close(fs);
 	ctx->fs = NULL;
--- e2fsprogs-1.42.7/tests/f_orphan_indirect_inode/expect.1.0002	2012-07-30 23:41:44.000000000 +0100
+++ e2fsprogs-1.42.7/tests/f_orphan_indirect_inode/expect.1	2013-03-13 12:46:11.388723938 +0000
@@ -1,2 +1 @@
-test_filesys: clean, 12/16 files, 21/100 blocks
 Exit status is 0
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to