1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 52_bootlogd_createlogfile.dpatch by <jdthood@yahoo.co.uk>
4
## All lines beginning with `## DP:' are a description of the patch.
8
diff -urNad --exclude=CVS --exclude=.svn ./man/bootlogd.8 /tmp/dpep-work.PNSf00/trunk/man/bootlogd.8
9
--- ./man/bootlogd.8 2006-03-19 17:51:42.000000000 +0100
10
+++ /tmp/dpep-work.PNSf00/trunk/man/bootlogd.8 2006-03-19 17:51:42.000000000 +0100
12
bootlogd \- record boot messages
22
Do not fork and run in the background.
24
+Attempt to write to the logfile even if it does not yet exist.
27
+will wait for the logfile to appear before attempting to write to it.
28
+This behavior prevents bootlogd from creating logfiles under mount points.
30
If there is an existing logfile called \fIlogfile\fP rename it to
31
\fIlogfile~\fP unless \fIlogfile~\fP already exists.
32
diff -urNad --exclude=CVS --exclude=.svn ./src/bootlogd.c /tmp/dpep-work.PNSf00/trunk/src/bootlogd.c
33
--- ./src/bootlogd.c 2006-03-19 17:51:42.000000000 +0100
34
+++ /tmp/dpep-work.PNSf00/trunk/src/bootlogd.c 2006-03-19 17:52:39.000000000 +0100
39
+int createlogfile = 0;
47
- fprintf(stderr, "Usage: bootlogd [-v] [-r] [-d] [-p pidfile] [-l logfile]\n");
48
+ fprintf(stderr, "Usage: bootlogd [-v] [-r] [-d] [-s] [-c] [-p pidfile] [-l logfile]\n");
56
- while ((i = getopt(argc, argv, "dsl:p:rv")) != EOF) switch(i) {
57
+ while ((i = getopt(argc, argv, "cdsl:p:rv")) != EOF) switch(i) {
73
* Perhaps we need to open the logfile.
75
- if (fp == NULL && rotate && access(logfile, F_OK) == 0) {
76
- snprintf(buf, sizeof(buf), "%s~", logfile);
77
- rename(logfile, buf);
78
+ if (fp == NULL && access(logfile, F_OK) == 0) {
80
+ snprintf(buf, sizeof(buf), "%s~", logfile);
81
+ rename(logfile, buf);
83
+ fp = fopen(logfile, "a");
86
+ if (fp == NULL && createlogfile)
87
fp = fopen(logfile, "a");
90
todo = inptr - outptr;