#! /bin/sh /usr/share/dpatch/dpatch-run ## 51_bootlogd_syncalot.dpatch by Thomas Hood ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Only fdatasync() if -s option given @DPATCH@ diff -urNad --exclude=CVS --exclude=.svn ./man/bootlogd.8 /tmp/dpep-work.bY0gSg/trunk/man/bootlogd.8 --- ./man/bootlogd.8 2006-01-23 11:17:20.000000000 +0100 +++ /tmp/dpep-work.bY0gSg/trunk/man/bootlogd.8 2006-01-23 11:23:47.000000000 +0100 @@ -5,6 +5,7 @@ .B /sbin/bootlogd .RB [ \-d ] .RB [ \-r ] +.RB [ \-s ] .RB [ \-v ] .RB [ " -l logfile " ] .RB [ " -p pidfile " ] @@ -18,6 +19,12 @@ .IP \fB\-r\fP If there is an existing logfile called \fIlogfile\fP rename it to \fIlogfile~\fP unless \fIlogfile~\fP already exists. +.IP \fB\-s\fP +Ensure that the data is written to the file after each line by calling +.BR fdatasync (3). +This will slow down a +.BR fsck (8) +process running in parallel. .IP \fB\-v\fP Show version. .IP "\fB\-l\fP \fIlogfile\fP" @@ -38,4 +45,4 @@ .SH AUTHOR Miquel van Smoorenburg, miquels@cistron.nl .SH "SEE ALSO" -.BR dmesg (8) +.BR dmesg "(8), " fdatasync (3). diff -urNad --exclude=CVS --exclude=.svn ./src/bootlogd.c /tmp/dpep-work.bY0gSg/trunk/src/bootlogd.c --- ./src/bootlogd.c 2006-01-23 11:17:21.000000000 +0100 +++ /tmp/dpep-work.bY0gSg/trunk/src/bootlogd.c 2006-01-23 11:19:23.000000000 +0100 @@ -56,6 +56,7 @@ int got_signal = 0; int didnl = 1; +int syncalot = 0; struct line { char buf[256]; @@ -337,7 +338,7 @@ break; case '\n': didnl = 1; - dosync = 1; + dosync = syncalot; break; case '\t': line.pos += (line.pos / 8 + 1) * 8; @@ -446,7 +447,7 @@ rotate = 0; dontfork = 0; - while ((i = getopt(argc, argv, "dl:p:rv")) != EOF) switch(i) { + while ((i = getopt(argc, argv, "dsl:p:rv")) != EOF) switch(i) { case 'l': logfile = optarg; break; @@ -463,6 +464,9 @@ case 'd': dontfork = 1; break; + case 's': + syncalot = 1; + break; default: usage(); break;