[Pkg-sysvinit-commits] r685 - in sysvinit/trunk/debian: . initscripts/etc/init.d patches

Thomas Hood jdthood-guest at costa.debian.org
Mon Jan 23 11:03:50 UTC 2006


Author: jdthood-guest
Date: 2006-01-23 11:03:49 +0000 (Mon, 23 Jan 2006)
New Revision: 685

Added:
   sysvinit/trunk/debian/patches/52_bootlogd_createlogfile.dpatch
Modified:
   sysvinit/trunk/debian/changelog
   sysvinit/trunk/debian/initscripts/etc/init.d/bootlogd
   sysvinit/trunk/debian/patches/00list
Log:
Don't create logfile unless -c option given

Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog	2006-01-23 11:01:23 UTC (rev 684)
+++ sysvinit/trunk/debian/changelog	2006-01-23 11:03:49 UTC (rev 685)
@@ -1,8 +1,12 @@
 sysvinit (2.86.ds1-12~1) unstable; urgency=low
 
   [ Thomas Hood ]
-  * bootlogd: Don't sync after each line unless (new) -s option given
+  * bootlogd: 51_bootlogd_syncalot: Don't sync after each line unless
+    the (new) -s option is given
     (Closes: #205724)
+  * bootlogd: 52_bootlogd_createlogfile.dpatch: Don't write to logfile
+    if it doesn't exist unless the (new) -c option is given
+    (Closes: #341167)
 
  -- Thomas Hood <jdthood at yahoo.co.uk>  Mon, 23 Jan 2006 11:24:47 +0100
 

Modified: sysvinit/trunk/debian/initscripts/etc/init.d/bootlogd
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/bootlogd	2006-01-23 11:01:23 UTC (rev 684)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/bootlogd	2006-01-23 11:03:49 UTC (rev 685)
@@ -14,7 +14,7 @@
 DAEMON=/sbin/bootlogd
 NAME=bootlogd
 DESC="boot logger"
-BOOTLOGD_OPTS="-r"
+BOOTLOGD_OPTS="-r -c"
 [ -r /etc/default/bootlogd ] && . /etc/default/bootlogd
 
 [ -x "$DAEMON" ] || exit 0

Modified: sysvinit/trunk/debian/patches/00list
===================================================================
--- sysvinit/trunk/debian/patches/00list	2006-01-23 11:01:23 UTC (rev 684)
+++ sysvinit/trunk/debian/patches/00list	2006-01-23 11:03:49 UTC (rev 685)
@@ -13,6 +13,7 @@
 45_pidof_symlink
 50_bootlogd_exitcode
 51_bootlogd_syncalot
+52_bootlogd_createlogfile
 60_init_race
 61_init_msg
 62_init_freebsdterm

Added: sysvinit/trunk/debian/patches/52_bootlogd_createlogfile.dpatch
===================================================================
--- sysvinit/trunk/debian/patches/52_bootlogd_createlogfile.dpatch	2006-01-23 11:01:23 UTC (rev 684)
+++ sysvinit/trunk/debian/patches/52_bootlogd_createlogfile.dpatch	2006-01-23 11:03:49 UTC (rev 685)
@@ -0,0 +1,82 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 52_bootlogd_createlogfile.dpatch by  <jdthood at yahoo.co.uk>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad --exclude=CVS --exclude=.svn ./man/bootlogd.8 /tmp/dpep-work.pguvwr/trunk/man/bootlogd.8
+--- ./man/bootlogd.8	2006-01-23 11:38:17.000000000 +0100
++++ /tmp/dpep-work.pguvwr/trunk/man/bootlogd.8	2006-01-23 11:55:45.000000000 +0100
+@@ -3,6 +3,7 @@
+ bootlogd \- record boot messages
+ .SH SYNOPSIS
+ .B /sbin/bootlogd
++.RB [ \-c ]
+ .RB [ \-d ]
+ .RB [ \-r ]
+ .RB [ \-s ]
+@@ -16,6 +17,12 @@
+ .SH OPTIONS
+ .IP \fB\-d\fP
+ Do not fork and run in the background.
++.IP \fB\-c\fP
++Attempt to write to the logfile even if it does not yet exist.
++Without this option,
++.B bootlogd
++will wait for the logfile to appear before attempting to write to it.
++This behavior prevents bootlogd from creating logfiles under mount points.
+ .IP \fB\-r\fP
+ If there is an existing logfile called \fIlogfile\fP rename it to
+ \fIlogfile~\fP unless \fIlogfile~\fP already exists.
+diff -urNad --exclude=CVS --exclude=.svn ./src/bootlogd.c /tmp/dpep-work.pguvwr/trunk/src/bootlogd.c
+--- ./src/bootlogd.c	2006-01-23 11:38:17.000000000 +0100
++++ /tmp/dpep-work.pguvwr/trunk/src/bootlogd.c	2006-01-23 11:51:12.000000000 +0100
+@@ -56,6 +56,7 @@
+ 
+ int got_signal = 0;
+ int didnl = 1;
++int createlogfile = 0;
+ int syncalot = 0;
+ 
+ struct line {
+@@ -447,7 +448,7 @@
+ 	rotate = 0;
+ 	dontfork = 0;
+ 
+-	while ((i = getopt(argc, argv, "dsl:p:rv")) != EOF) switch(i) {
++	while ((i = getopt(argc, argv, "cdsl:p:rv")) != EOF) switch(i) {
+ 		case 'l':
+ 			logfile = optarg;
+ 			break;
+@@ -461,6 +462,9 @@
+ 		case 'p':
+ 			pidfile = optarg;
+ 			break;
++		case 'c':
++			createlogfile = 1;
++			break;
+ 		case 'd':
+ 			dontfork = 1;
+ 			break;
+@@ -613,12 +617,16 @@
+ 		/*
+ 		 *	Perhaps we need to open the logfile.
+ 		 */
+-		if (fp == NULL && rotate && access(logfile, F_OK) == 0) {
+-			snprintf(buf, sizeof(buf), "%s~", logfile);
+-			rename(logfile, buf);
++		if (fp == NULL && access(logfile, F_OK) == 0) {
++			if (rotate) {
++				snprintf(buf, sizeof(buf), "%s~", logfile);
++				rename(logfile, buf);
++			}
++			fp = fopen(logfile, "a");
+ 		}
+-		if (fp == NULL)
++		if (fp == NULL && createlogfile)
+ 			fp = fopen(logfile, "a");
++
+ 		if (inptr >= outptr)
+ 			todo = inptr - outptr;
+ 		else


Property changes on: sysvinit/trunk/debian/patches/52_bootlogd_createlogfile.dpatch
___________________________________________________________________
Name: svn:executable
   + *




More information about the Pkg-sysvinit-commits mailing list