-.\" $OpenBSD: syslogd.8,v 1.53 2017/01/02 15:58:02 bluhm Exp $
+.\" $OpenBSD: syslogd.8,v 1.54 2017/04/17 14:18:44 bluhm Exp $
.\"
.\" Copyright (c) 1983, 1986, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\" from: @(#)syslogd.8 8.1 (Berkeley) 6/6/93
.\" $NetBSD: syslogd.8,v 1.3 1996/01/02 17:41:48 perry Exp $
.\"
-.Dd $Mdocdate: January 2 2017 $
+.Dd $Mdocdate: April 17 2017 $
.Dt SYSLOGD 8
.Os
.Sh NAME
.Sh SYNOPSIS
.Nm syslogd
.Bk -words
-.Op Fl 46dFhnuVZ
+.Op Fl 46dFhnruVZ
.Op Fl a Ar path
.Op Fl C Ar CAfile
.Op Fl c Ar cert_file
Specify the pathname of an alternate log socket to be used instead;
the default is
.Pa /dev/log .
+.It Fl r
+Print duplicate lines immediately and suppress the "last message
+repeated" summary when piping to another program or forwarding to
+a remote loghost.
+If given twice, this is done for all log actions.
.It Fl S Ar listen_address
Create a TLS listen socket for receiving encrypted messages and
bind it to the specified address.
-/* $OpenBSD: syslogd.c,v 1.241 2017/04/07 15:36:16 bluhm Exp $ */
+/* $OpenBSD: syslogd.c,v 1.242 2017/04/17 14:18:44 bluhm Exp $ */
/*
* Copyright (c) 1983, 1988, 1993, 1994
int MarkInterval = 20 * 60; /* interval between marks in seconds */
int MarkSeq = 0; /* mark sequence number */
int PrivChild = 0; /* Exec the privileged parent process */
+int Repeat = 0; /* 0 msg repeated, 1 in files only, 2 never */
int SecureMode = 1; /* when true, speak only unix domain socks */
int NoDNS = 0; /* when true, refrain from doing DNS lookups */
int ZuluTime = 0; /* display date and time in UTC ISO format */
tls_hostport = tls_host = NULL;
nbind = nlisten = 0;
- while ((ch = getopt(argc, argv, "46a:C:c:dFf:hK:k:m:nP:p:S:s:T:U:uVZ"))
- != -1)
+ while ((ch = getopt(argc, argv,
+ "46a:C:c:dFf:hK:k:m:nP:p:rS:s:T:U:uVZ")) != -1) {
switch (ch) {
case '4': /* disable IPv6 */
Family = PF_INET;
case 'p': /* path */
path_unix[0] = optarg;
break;
+ case 'r':
+ Repeat++;
+ break;
case 'S': /* allow tls and listen on address */
tls_hostport = optarg;
if ((p = strdup(optarg)) == NULL)
default:
usage();
}
+ }
if (argc != optind)
usage();
{
(void)fprintf(stderr,
- "usage: syslogd [-46dFhnuVZ] [-a path] [-C CAfile] [-c cert_file]\n"
- "\t[-f config_file] [-K CAfile] [-k key_file] [-m mark_interval]\n"
- "\t[-p log_socket] [-S listen_address] [-s reporting_socket]\n"
- "\t[-T listen_address] [-U bind_address]\n");
+ "usage: syslogd [-46dFhnruVZ] [-a path] [-C CAfile]\n"
+ "\t[-c cert_file] [-f config_file] [-K CAfile] [-k key_file]\n"
+ "\t[-m mark_interval] [-p log_socket] [-S listen_address]\n"
+ "\t[-s reporting_socket] [-T listen_address] [-U bind_address]\n");
exit(1);
}
/*
* suppress duplicate lines to this file
*/
- if ((flags & MARK) == 0 && msglen == f->f_prevlen &&
+ if ((Repeat == 0 || (Repeat == 1 &&
+ (f->f_type != F_PIPE && f->f_type != F_FORWUDP &&
+ f->f_type != F_FORWTCP && f->f_type != F_FORWTLS))) &&
+ (flags & MARK) == 0 && msglen == f->f_prevlen &&
!strcmp(msg, f->f_prevline) &&
!strcmp(from, f->f_prevhost)) {
strlcpy(f->f_lasttime, timestamp,