summaryrefslogtreecommitdiffstats
path: root/source/a/sysklogd/sysklogd.allow.repeated.messages.diff
blob: 41e6bf15dd8b94c5ee4040a02b2f5dff9c9c628d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
--- ./syslogd.c.orig	2014-10-04 14:47:18.000000000 -0500
+++ ./syslogd.c	2016-06-29 01:46:39.355541929 -0500
@@ -776,6 +776,7 @@
 };
 
 int	Debug;			/* debug flag */
+int	Compress = 1;		/* compress repeated messages flag */
 char	LocalHostName[MAXHOSTNAMELEN+1];	/* our hostname */
 char	*LocalDomain;		/* our local domain name */
 char	*emptystring = "";
@@ -888,7 +889,7 @@
 		funix[i]  = -1;
 	}
 
-	while ((ch = getopt(argc, argv, "a:dhf:l:m:np:rs:v")) != EOF)
+	while ((ch = getopt(argc, argv, "a:cdhf:l:m:np:rs:v")) != EOF)
 		switch((char)ch) {
 		case 'a':
 			if (nfunix < MAXFUNIX)
@@ -896,6 +897,9 @@
 			else
 				fprintf(stderr, "Out of descriptors, ignoring %s\n", optarg);
 			break;
+		case 'c':		/* don't compress repeated messages */
+			Compress = 0;
+			break;
 		case 'd':		/* debug */
 			Debug = 1;
 			break;
@@ -1240,7 +1244,7 @@
 
 int usage()
 {
-	fprintf(stderr, "usage: syslogd [-drvh] [-l hostlist] [-m markinterval] [-n] [-p path]\n" \
+	fprintf(stderr, "usage: syslogd [-cdrvh] [-l hostlist] [-m markinterval] [-n] [-p path]\n" \
 		" [-s domainlist] [-f conffile]\n");
 	exit(1);
 }
@@ -1703,7 +1707,7 @@
 		/*
 		 * suppress duplicate lines to this file
 		 */
-		if ((flags & MARK) == 0 && msglen == f->f_prevlen &&
+		if (Compress && (flags & MARK) == 0 && msglen == f->f_prevlen &&
 		    !strcmp(msg, f->f_prevline) &&
 		    !strcmp(from, f->f_prevhost)) {
 			(void) strncpy(f->f_lasttime, timestamp, 15);
--- ./sysklogd.8.orig	2014-10-04 14:47:18.000000000 -0500
+++ ./sysklogd.8	2016-06-29 01:59:45.311525189 -0500
@@ -10,6 +10,7 @@
 .RB [ " \-a "
 .I socket
 ]
+.RB [ " \-c " ]
 .RB [ " \-d " ]
 .RB [ " \-f "
 .I config file
@@ -83,6 +84,11 @@
 described by the people from OpenBSD at
 <http://www.guides.sk/psionic/dns/>.
 .TP
+.B "\-c"
+Disable the repeating line compression that normally suppresses the
+repeated lines and logs a message such as 'last message repeated 124
+times'.  With this option, all repeated lines will be logged.
+.TP
 .B "\-d"
 Turns on debug mode.  Using this the daemon will not proceed a 
 .BR fork (2)