CVS commit: src/usr.bin/newsyslog

2021-03-02 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Mar  2 10:17:25 UTC 2021

Modified Files:
src/usr.bin/newsyslog: newsyslog.8

Log Message:
Use proper -width instead of the cargo-cult value.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/newsyslog/newsyslog.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/newsyslog/newsyslog.8
diff -u src/usr.bin/newsyslog/newsyslog.8:1.45 src/usr.bin/newsyslog/newsyslog.8:1.46
--- src/usr.bin/newsyslog/newsyslog.8:1.45	Tue Mar  2 10:14:59 2021
+++ src/usr.bin/newsyslog/newsyslog.8	Tue Mar  2 10:17:25 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: newsyslog.8,v 1.45 2021/03/02 10:14:59 uwe Exp $
+.\"	$NetBSD: newsyslog.8,v 1.46 2021/03/02 10:17:25 uwe Exp $
 .\"
 .\" Copyright (c) 1999, 2000 Andrew Doran 
 .\" All rights reserved.
@@ -108,7 +108,7 @@ Blank lines or lines beginning with
 are ignored.
 The fields of the configuration file are as
 follows:
-.Bl -tag -width indent
+.Bl -tag -width Fl
 .It Ar logfile_name
 Name of the system log file to be archived.
 .It Ar owner Ns Li \&: Ns Ar group



CVS commit: src/usr.bin/newsyslog

2021-03-02 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Mar  2 10:17:25 UTC 2021

Modified Files:
src/usr.bin/newsyslog: newsyslog.8

Log Message:
Use proper -width instead of the cargo-cult value.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/newsyslog/newsyslog.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/newsyslog

2021-03-02 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Mar  2 10:14:59 UTC 2021

Modified Files:
src/usr.bin/newsyslog: newsyslog.8

Log Message:
Sort config file flags and command line options.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/newsyslog/newsyslog.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/newsyslog/newsyslog.8
diff -u src/usr.bin/newsyslog/newsyslog.8:1.44 src/usr.bin/newsyslog/newsyslog.8:1.45
--- src/usr.bin/newsyslog/newsyslog.8:1.44	Tue Mar  2 10:12:33 2021
+++ src/usr.bin/newsyslog/newsyslog.8	Tue Mar  2 10:14:59 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: newsyslog.8,v 1.44 2021/03/02 10:12:33 uwe Exp $
+.\"	$NetBSD: newsyslog.8,v 1.45 2021/03/02 10:14:59 uwe Exp $
 .\"
 .\" Copyright (c) 1999, 2000 Andrew Doran 
 .\" All rights reserved.
@@ -320,16 +320,16 @@ This flag is mostly usable in conjunctio
 flag that prevents
 .Nm
 from inserting an ASCII informational message.
+.It Ic j
+Archived log files should be compressed with
+.Xr bzip2 1
+to save space.
 .It Ic n
 No signal should be sent when the log is trimmed.
 .It Ic p
 The first historical log file (i.e. the historical log file with the suffix
 .Ql \.0 )
 should not be compressed.
-.It Ic j
-Archived log files should be compressed with
-.Xr bzip2 1
-to save space.
 .It Ic x
 Archived log files should be compressed with
 .Xr xz 1
@@ -364,6 +364,10 @@ By default a
 .Sh OPTIONS
 The following options can be used with newsyslog:
 .Bl -tag -width indent
+.It Fl F
+Force trimming of the logs, even if the trim conditions have not been met.
+This option is useful for diagnosing system problems by providing you with
+fresh logs.
 .It Fl f Ar config_file
 Use
 .Ar config_file
@@ -393,10 +397,6 @@ Do not signal daemon processes.
 .It Fl v
 Run in verbose mode.
 In this mode each action that is taken will be printed.
-.It Fl F
-Force trimming of the logs, even if the trim conditions have not been met.
-This option is useful for diagnosing system problems by providing you with
-fresh logs.
 .El
 .Pp
 If additional command line arguments are given,



CVS commit: src/usr.bin/newsyslog

2021-03-02 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Mar  2 10:14:59 UTC 2021

Modified Files:
src/usr.bin/newsyslog: newsyslog.8

Log Message:
Sort config file flags and command line options.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/newsyslog/newsyslog.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/newsyslog

2021-03-02 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Mar  2 10:12:33 UTC 2021

Modified Files:
src/usr.bin/newsyslog: newsyslog.8

Log Message:
Fix markup so that literals are typeset as literals.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/newsyslog/newsyslog.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/newsyslog

2021-03-02 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Mar  2 10:12:33 UTC 2021

Modified Files:
src/usr.bin/newsyslog: newsyslog.8

Log Message:
Fix markup so that literals are typeset as literals.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/newsyslog/newsyslog.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/newsyslog/newsyslog.8
diff -u src/usr.bin/newsyslog/newsyslog.8:1.43 src/usr.bin/newsyslog/newsyslog.8:1.44
--- src/usr.bin/newsyslog/newsyslog.8:1.43	Mon Mar  1 21:43:00 2021
+++ src/usr.bin/newsyslog/newsyslog.8	Tue Mar  2 10:12:33 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: newsyslog.8,v 1.43 2021/03/01 21:43:00 wiz Exp $
+.\"	$NetBSD: newsyslog.8,v 1.44 2021/03/02 10:12:33 uwe Exp $
 .\"
 .\" Copyright (c) 1999, 2000 Andrew Doran 
 .\" All rights reserved.
@@ -104,17 +104,17 @@ that should be handled by
 Each line has six mandatory fields and three optional fields, with
 whitespace separating each field.
 Blank lines or lines beginning with
-.Dq #
+.Ql #
 are ignored.
 The fields of the configuration file are as
 follows:
 .Bl -tag -width indent
 .It Ar logfile_name
 Name of the system log file to be archived.
-.It Ar owner:group
+.It Ar owner Ns Li \&: Ns Ar group
 This optional field specifies the owner and group for the archive file.
 The
-.Dq \&:
+.Ql \&:
 is essential, even if the
 .Ar owner
 or
@@ -125,9 +125,9 @@ The field may be numeric, or a name whic
 or
 .Pa /etc/group .
 For backward compatibility,
-.Dq \&\.
+.Ql \&.
 is usable in lieu of
-.Dq \&: ,
+.Ql \&: ,
 however use of this feature is discouraged.
 .It Ar mode
 Specify the mode of the log file and archives.
@@ -245,22 +245,22 @@ The lead-in character for day, week and 
 .So Li \&$ Sc Ns No -sign .
 The particular format of day, week and month specification is:
 .Oo
-.Va D\
+.Li D Ns Va \
 .Oc ,
 .Sm off
 .Oo
-.Va W\
+.Li W Ns Va \
 .Oo
-.Va D\
+.Li D Ns Va \
 .Oc
 .Oc
 .Sm on
 and
 .Sm off
 .Oo
-.Va M\
+.Li M Ns Va \
 .Oo
-.Va D\
+.Li D Ns Va \
 .Oc
 .Oc
 .Sm on
@@ -275,26 +275,26 @@ hours, range 0 ... 23
 day of week, range 0 ... 6, 0 = Sunday
 .It Ar dd
 day of month, range 1 ... 31, or the letter
-.Em L
+.Ql L
 or
-.Em l
+.Ql l
 to specify the last day of the month.
 .El
 .Pp
 Some examples:
 .Pp
 .Bl -tag -width Ds -compact -offset indent
-.It Ar $D0
+.It Li $D0
 rotate every night at midnight
-.It Ar $D23
+.It Li $D23
 rotate every day at 23:00 hr
-.It Ar $W0D23
+.It Li $W0D23
 rotate every week on Sunday at 23:00 hr
-.It Ar $W5D16
+.It Li $W5D16
 rotate every week on Friday at 16:00 hr
-.It Ar $MLD0
+.It Li $MLD0
 rotate at the last day of every month at midnight
-.It Ar $M5D6
+.It Li $M5D6
 rotate on every 5th day of month at 6:00 hr
 .El
 .It Ar flags
@@ -303,38 +303,38 @@ These flags are parsed in a case insensi
 Individual
 flags and their meanings:
 .Bl -tag -width indent
-.It Sy -
-This flag means nothing - it is used as a spacer when no flags are set.
-.It Sy b
+.It Ic \-
+This flag means nothing \(em it is used as a spacer when no flags are set.
+.It Ic b
 The file is a binary file or is not in
 .Xr syslogd 8
 format: the ASCII message which
 .Nm
 inserts to indicate that the logs have been trimmed should not be included.
-.It Sy c
+.It Ic c
 Create an empty log file if none currently exists.
-.It Sy e
+.It Ic e
 Do not rotate log file with zero size (empty).
 This flag is mostly usable in conjunction with
-.Ar b
+.Ic b
 flag that prevents
 .Nm
 from inserting an ASCII informational message.
-.It Sy n
+.It Ic n
 No signal should be sent when the log is trimmed.
-.It Sy p
+.It Ic p
 The first historical log file (i.e. the historical log file with the suffix
-.Dq \.0 )
+.Ql \.0 )
 should not be compressed.
-.It Sy j
+.It Ic j
 Archived log files should be compressed with
 .Xr bzip2 1
 to save space.
-.It Sy x
+.It Ic x
 Archived log files should be compressed with
 .Xr xz 1
 to save space.
-.It Sy z
+.It Ic z
 Archived log files should be compressed with
 .Xr gzip 1
 to save space.
@@ -351,13 +351,15 @@ is sent to the process id contained in t
 .Ar path_to_pid_file
 file.
 This field must start with
-.Sq /
+.Ql /
 in order to be recognized properly.
 .It Ar sigtype
 This optional field specifies the type of signal to be sent to the daemon
 process.
 This may be a numeric or symbolic value.
-By default a SIGHUP (hang-up) will be sent.
+By default a
+.Dv SIGHUP
+(hang-up) will be sent.
 .El
 .Sh OPTIONS
 The following options can be used with newsyslog:
@@ -380,7 +382,9 @@ Remove the restriction that
 must be running as root.
 When running as a regular user,
 .Nm
-will not be able to send a HUP signal to
+will not be able to send a
+.Dv SIGHUP
+signal to
 .Xr syslogd 8 ,
 so this option should be used only when debugging or trimming user generated
 logs.



CVS commit: src/usr.bin/newsyslog

2021-03-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Mar  1 21:43:00 UTC 2021

Modified Files:
src/usr.bin/newsyslog: newsyslog.8

Log Message:
Sort options in synopsis


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/usr.bin/newsyslog/newsyslog.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/newsyslog

2021-03-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Mar  1 21:43:00 UTC 2021

Modified Files:
src/usr.bin/newsyslog: newsyslog.8

Log Message:
Sort options in synopsis


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/usr.bin/newsyslog/newsyslog.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/newsyslog/newsyslog.8
diff -u src/usr.bin/newsyslog/newsyslog.8:1.42 src/usr.bin/newsyslog/newsyslog.8:1.43
--- src/usr.bin/newsyslog/newsyslog.8:1.42	Mon Mar  1 21:37:10 2021
+++ src/usr.bin/newsyslog/newsyslog.8	Mon Mar  1 21:43:00 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: newsyslog.8,v 1.42 2021/03/01 21:37:10 otis Exp $
+.\"	$NetBSD: newsyslog.8,v 1.43 2021/03/01 21:43:00 wiz Exp $
 .\"
 .\" Copyright (c) 1999, 2000 Andrew Doran 
 .\" All rights reserved.
@@ -49,7 +49,7 @@
 .Nd maintain system log files to manageable sizes
 .Sh SYNOPSIS
 .Nm newsyslog
-.Op Fl nrsvF
+.Op Fl Fnrsv
 .Op Fl f Ar config_file
 .Op Pa file ...
 .Sh DESCRIPTION



CVS commit: src/usr.bin/newsyslog

2021-03-01 Thread Juraj Lutter
Module Name:src
Committed By:   otis
Date:   Mon Mar  1 21:37:10 UTC 2021

Modified Files:
src/usr.bin/newsyslog: newsyslog.8 newsyslog.c

Log Message:
Implement 'E' flag that prevents newsyslog from rotating empty log files.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.bin/newsyslog/newsyslog.8
cvs rdiff -u -r1.61 -r1.62 src/usr.bin/newsyslog/newsyslog.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/newsyslog/newsyslog.8
diff -u src/usr.bin/newsyslog/newsyslog.8:1.41 src/usr.bin/newsyslog/newsyslog.8:1.42
--- src/usr.bin/newsyslog/newsyslog.8:1.41	Mon Oct 23 01:06:52 2017
+++ src/usr.bin/newsyslog/newsyslog.8	Mon Mar  1 21:37:10 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: newsyslog.8,v 1.41 2017/10/23 01:06:52 wiz Exp $
+.\"	$NetBSD: newsyslog.8,v 1.42 2021/03/01 21:37:10 otis Exp $
 .\"
 .\" Copyright (c) 1999, 2000 Andrew Doran 
 .\" All rights reserved.
@@ -40,7 +40,7 @@
 .\"
 .\" from FreeBSD: newsyslog.8,v 1.14.2.1 1999/02/25 18:38:33 wollman Exp
 .\"
-.Dd June 16, 2012
+.Dd March 1, 2021
 .Dt NEWSYSLOG 8
 .Os
 .Sh NAME
@@ -313,6 +313,13 @@ format: the ASCII message which
 inserts to indicate that the logs have been trimmed should not be included.
 .It Sy c
 Create an empty log file if none currently exists.
+.It Sy e
+Do not rotate log file with zero size (empty).
+This flag is mostly usable in conjunction with
+.Ar b
+flag that prevents
+.Nm
+from inserting an ASCII informational message.
 .It Sy n
 No signal should be sent when the log is trimmed.
 .It Sy p

Index: src/usr.bin/newsyslog/newsyslog.c
diff -u src/usr.bin/newsyslog/newsyslog.c:1.61 src/usr.bin/newsyslog/newsyslog.c:1.62
--- src/usr.bin/newsyslog/newsyslog.c:1.61	Thu Sep  5 11:34:40 2013
+++ src/usr.bin/newsyslog/newsyslog.c	Mon Mar  1 21:37:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: newsyslog.c,v 1.61 2013/09/05 11:34:40 prlw1 Exp $	*/
+/*	$NetBSD: newsyslog.c,v 1.62 2021/03/01 21:37:10 otis Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Andrew Doran 
@@ -55,7 +55,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: newsyslog.c,v 1.61 2013/09/05 11:34:40 prlw1 Exp $");
+__RCSID("$NetBSD: newsyslog.c,v 1.62 2021/03/01 21:37:10 otis Exp $");
 #endif /* not lint */
 
 #include 
@@ -94,6 +94,7 @@ __RCSID("$NetBSD: newsyslog.c,v 1.61 201
 #define	CE_PLAIN0	0x10	/* Do not compress zero'th history file */
 #define	CE_SYSLPROTOCOL 0x20	/* log in syslog-protocol format,
    not configurable but detected at runtime */
+#define	CE_NOEMPTY	0x40	/* Do not rotate empty log file */
 
 struct conf_entry {
 	uid_t	uid;			/* Owner of log */
@@ -372,6 +373,9 @@ parse_cfgline(struct conf_entry *log, FI
 		case 'C':
 			log->flags |= CE_CREATE;
 			break;
+		case 'E':
+			log->flags |= CE_NOEMPTY;
+			break;
 		case 'N':
 			log->flags |= CE_NOSIGNAL;
 			break;
@@ -462,6 +466,14 @@ log_examine(struct conf_entry *log, int 
 		return;
 	}
 
+	/* Skip rotation of empty log file when flag
+	 * E is specified
+	 */
+	if (sb.st_size == 0 && (log->flags & CE_NOEMPTY) != 0) {
+		PRHDRINFO(("empty file --> skip log\n"));
+		return;
+	}
+
 	/* Size of the log file in kB. */
 	size = ((size_t)sb.st_blocks * S_BLKSIZE) >> 10;
 



CVS commit: src/usr.bin/newsyslog

2021-03-01 Thread Juraj Lutter
Module Name:src
Committed By:   otis
Date:   Mon Mar  1 21:37:10 UTC 2021

Modified Files:
src/usr.bin/newsyslog: newsyslog.8 newsyslog.c

Log Message:
Implement 'E' flag that prevents newsyslog from rotating empty log files.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.bin/newsyslog/newsyslog.8
cvs rdiff -u -r1.61 -r1.62 src/usr.bin/newsyslog/newsyslog.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/newsyslog

2017-10-22 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Oct 23 01:06:52 UTC 2017

Modified Files:
src/usr.bin/newsyslog: newsyslog.8

Log Message:
Remove superfluous Tn.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/usr.bin/newsyslog/newsyslog.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/newsyslog

2017-10-22 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Oct 23 01:06:52 UTC 2017

Modified Files:
src/usr.bin/newsyslog: newsyslog.8

Log Message:
Remove superfluous Tn.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/usr.bin/newsyslog/newsyslog.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/newsyslog/newsyslog.8
diff -u src/usr.bin/newsyslog/newsyslog.8:1.40 src/usr.bin/newsyslog/newsyslog.8:1.41
--- src/usr.bin/newsyslog/newsyslog.8:1.40	Sun Oct 22 17:53:49 2017
+++ src/usr.bin/newsyslog/newsyslog.8	Mon Oct 23 01:06:52 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: newsyslog.8,v 1.40 2017/10/22 17:53:49 abhinav Exp $
+.\"	$NetBSD: newsyslog.8,v 1.41 2017/10/23 01:06:52 wiz Exp $
 .\"
 .\" Copyright (c) 1999, 2000 Andrew Doran 
 .\" All rights reserved.
@@ -158,9 +158,7 @@ Otherwise, the
 field consists of an optional interval in hours, optionally followed
 by an
 .So Li \&@ Sc Ns No -sign
-and a time in a restricted
-.Tn ISO 8601
-format or by an
+and a time in a restricted ISO 8601 format or by an
 .So Li \&$ Sc Ns No -sign
 and a time specification for logfile rotation at a fixed time once
 per day, per week or per month.
@@ -182,14 +180,9 @@ hour'.
 .Pp
 .Em ISO 8601 restricted time format
 .Pp
-The lead-in character for a restricted
-.Tn ISO 8601
-time is
-an
+The lead-in character for a restricted ISO 8601 time is an
 .So Li \&@ Sc Ns No -sign .
-The particular format of the time in restricted
-.Tn ISO 8601
-is:
+The particular format of the time in restricted ISO 8601 is:
 .Sm off
 .Oo
 .Oo
@@ -315,10 +308,7 @@ This flag means nothing - it is used as 
 .It Sy b
 The file is a binary file or is not in
 .Xr syslogd 8
-format:
-the
-.Tn ASCII
-message which
+format: the ASCII message which
 .Nm
 inserts to indicate that the logs have been trimmed should not be included.
 .It Sy c



CVS commit: src/usr.bin/newsyslog

2017-10-22 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Sun Oct 22 17:53:49 UTC 2017

Modified Files:
src/usr.bin/newsyslog: newsyslog.8

Log Message:
Add newsyslog.conf to the NAME section
Also fix couple of lint warnings from mandoc


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/usr.bin/newsyslog/newsyslog.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/newsyslog/newsyslog.8
diff -u src/usr.bin/newsyslog/newsyslog.8:1.39 src/usr.bin/newsyslog/newsyslog.8:1.40
--- src/usr.bin/newsyslog/newsyslog.8:1.39	Fri Dec 20 17:01:39 2013
+++ src/usr.bin/newsyslog/newsyslog.8	Sun Oct 22 17:53:49 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: newsyslog.8,v 1.39 2013/12/20 17:01:39 wiz Exp $
+.\"	$NetBSD: newsyslog.8,v 1.40 2017/10/22 17:53:49 abhinav Exp $
 .\"
 .\" Copyright (c) 1999, 2000 Andrew Doran 
 .\" All rights reserved.
@@ -44,7 +44,8 @@
 .Dt NEWSYSLOG 8
 .Os
 .Sh NAME
-.Nm newsyslog
+.Nm newsyslog ,
+.Nm newsyslog.conf
 .Nd maintain system log files to manageable sizes
 .Sh SYNOPSIS
 .Nm newsyslog
@@ -107,7 +108,6 @@ Blank lines or lines beginning with
 are ignored.
 The fields of the configuration file are as
 follows:
-.Pp
 .Bl -tag -width indent
 .It Ar logfile_name
 Name of the system log file to be archived.
@@ -304,7 +304,6 @@ rotate at the last day of every month at
 .It Ar $M5D6
 rotate on every 5th day of month at 6:00 hr
 .El
-.Pp
 .It Ar flags
 This field specifies any special processing that is required.
 These flags are parsed in a case insensitive manner.



CVS commit: src/usr.bin/newsyslog

2017-10-22 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Sun Oct 22 17:53:49 UTC 2017

Modified Files:
src/usr.bin/newsyslog: newsyslog.8

Log Message:
Add newsyslog.conf to the NAME section
Also fix couple of lint warnings from mandoc


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/usr.bin/newsyslog/newsyslog.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/newsyslog

2013-12-20 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Dec 20 10:14:25 UTC 2013

Modified Files:
src/usr.bin/newsyslog: newsyslog.8

Log Message:
Document what ngen 0 does.
From David Gutteridge in PR 48460.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/newsyslog/newsyslog.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/newsyslog/newsyslog.8
diff -u src/usr.bin/newsyslog/newsyslog.8:1.37 src/usr.bin/newsyslog/newsyslog.8:1.38
--- src/usr.bin/newsyslog/newsyslog.8:1.37	Sun Jun 17 03:52:32 2012
+++ src/usr.bin/newsyslog/newsyslog.8	Fri Dec 20 10:14:25 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: newsyslog.8,v 1.37 2012/06/17 03:52:32 christos Exp $
+.\	$NetBSD: newsyslog.8,v 1.38 2013/12/20 10:14:25 wiz Exp $
 .\
 .\ Copyright (c) 1999, 2000 Andrew Doran a...@netbsd.org
 .\ All rights reserved.
@@ -40,7 +40,7 @@
 .\
 .\ from FreeBSD: newsyslog.8,v 1.14.2.1 1999/02/25 18:38:33 wollman Exp
 .\
-.Dd June 16, 2012
+.Dd December 20, 2014
 .Dt NEWSYSLOG 8
 .Os
 .Sh NAME
@@ -134,6 +134,8 @@ Specify the mode of the log file and arc
 .It Ar ngen
 Specify the number of archive files to be kept
 besides the log file itself.
+A value of 0 disables the deletion of any archive files during log
+rotation.
 .It Ar size
 When the size of the log file reaches
 .Ar size



CVS commit: src/usr.bin/newsyslog

2013-12-20 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Dec 20 17:01:39 UTC 2013

Modified Files:
src/usr.bin/newsyslog: newsyslog.8

Log Message:
Revert previous, it was wrong.
From David H. Gutteridge in PR bin/48460.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.bin/newsyslog/newsyslog.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/newsyslog/newsyslog.8
diff -u src/usr.bin/newsyslog/newsyslog.8:1.38 src/usr.bin/newsyslog/newsyslog.8:1.39
--- src/usr.bin/newsyslog/newsyslog.8:1.38	Fri Dec 20 10:14:25 2013
+++ src/usr.bin/newsyslog/newsyslog.8	Fri Dec 20 17:01:39 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: newsyslog.8,v 1.38 2013/12/20 10:14:25 wiz Exp $
+.\	$NetBSD: newsyslog.8,v 1.39 2013/12/20 17:01:39 wiz Exp $
 .\
 .\ Copyright (c) 1999, 2000 Andrew Doran a...@netbsd.org
 .\ All rights reserved.
@@ -40,7 +40,7 @@
 .\
 .\ from FreeBSD: newsyslog.8,v 1.14.2.1 1999/02/25 18:38:33 wollman Exp
 .\
-.Dd December 20, 2014
+.Dd June 16, 2012
 .Dt NEWSYSLOG 8
 .Os
 .Sh NAME
@@ -134,8 +134,6 @@ Specify the mode of the log file and arc
 .It Ar ngen
 Specify the number of archive files to be kept
 besides the log file itself.
-A value of 0 disables the deletion of any archive files during log
-rotation.
 .It Ar size
 When the size of the log file reaches
 .Ar size



CVS commit: src/usr.bin/newsyslog

2013-12-20 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Dec 20 10:14:25 UTC 2013

Modified Files:
src/usr.bin/newsyslog: newsyslog.8

Log Message:
Document what ngen 0 does.
From David Gutteridge in PR 48460.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/newsyslog/newsyslog.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/newsyslog

2013-12-20 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Dec 20 17:01:39 UTC 2013

Modified Files:
src/usr.bin/newsyslog: newsyslog.8

Log Message:
Revert previous, it was wrong.
From David H. Gutteridge in PR bin/48460.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.bin/newsyslog/newsyslog.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/newsyslog

2013-09-05 Thread Patrick Welche
Module Name:src
Committed By:   prlw1
Date:   Thu Sep  5 11:34:40 UTC 2013

Modified Files:
src/usr.bin/newsyslog: newsyslog.c

Log Message:
Fix
/var/log/httpd/access.log  644  52   *  $W0D23 ZBP /var/run/httpd.pid 30
newsyslog: config line 16: bad signal type
(strtol: **endptr is '\0' on success rather than *endptr)


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/usr.bin/newsyslog/newsyslog.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/newsyslog/newsyslog.c
diff -u src/usr.bin/newsyslog/newsyslog.c:1.60 src/usr.bin/newsyslog/newsyslog.c:1.61
--- src/usr.bin/newsyslog/newsyslog.c:1.60	Sun Jun 17 03:52:32 2012
+++ src/usr.bin/newsyslog/newsyslog.c	Thu Sep  5 11:34:40 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: newsyslog.c,v 1.60 2012/06/17 03:52:32 christos Exp $	*/
+/*	$NetBSD: newsyslog.c,v 1.61 2013/09/05 11:34:40 prlw1 Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Andrew Doran a...@netbsd.org
@@ -55,7 +55,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: newsyslog.c,v 1.60 2012/06/17 03:52:32 christos Exp $);
+__RCSID($NetBSD: newsyslog.c,v 1.61 2013/09/05 11:34:40 prlw1 Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -824,7 +824,7 @@ getsig(const char *sig)
 	
 	if (isnumber(sig)) {
 		n = (int)strtol(sig, p, 0);
-		if (p != '\0' || n  0 || n = NSIG)
+		if (*p != '\0' || n  0 || n = NSIG)
 			return -1;
 		return n;
 	}



CVS commit: src/usr.bin/newsyslog

2013-09-05 Thread Patrick Welche
Module Name:src
Committed By:   prlw1
Date:   Thu Sep  5 11:34:40 UTC 2013

Modified Files:
src/usr.bin/newsyslog: newsyslog.c

Log Message:
Fix
/var/log/httpd/access.log  644  52   *  $W0D23 ZBP /var/run/httpd.pid 30
newsyslog: config line 16: bad signal type
(strtol: **endptr is '\0' on success rather than *endptr)


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/usr.bin/newsyslog/newsyslog.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/newsyslog

2012-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 17 03:52:33 UTC 2012

Modified Files:
src/usr.bin/newsyslog: newsyslog.8 newsyslog.c

Log Message:
PR/46608: Jim Bernard: Add xz conversion X


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/newsyslog/newsyslog.8
cvs rdiff -u -r1.59 -r1.60 src/usr.bin/newsyslog/newsyslog.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/newsyslog/newsyslog.8
diff -u src/usr.bin/newsyslog/newsyslog.8:1.36 src/usr.bin/newsyslog/newsyslog.8:1.37
--- src/usr.bin/newsyslog/newsyslog.8:1.36	Fri Dec 21 14:45:33 2007
+++ src/usr.bin/newsyslog/newsyslog.8	Sat Jun 16 23:52:32 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: newsyslog.8,v 1.36 2007/12/21 19:45:33 snj Exp $
+.\	$NetBSD: newsyslog.8,v 1.37 2012/06/17 03:52:32 christos Exp $
 .\
 .\ Copyright (c) 1999, 2000 Andrew Doran a...@netbsd.org
 .\ All rights reserved.
@@ -40,7 +40,7 @@
 .\
 .\ from FreeBSD: newsyslog.8,v 1.14.2.1 1999/02/25 18:38:33 wollman Exp
 .\
-.Dd December 21, 2007
+.Dd June 16, 2012
 .Dt NEWSYSLOG 8
 .Os
 .Sh NAME
@@ -334,6 +334,10 @@ should not be compressed.
 Archived log files should be compressed with
 .Xr bzip2 1
 to save space.
+.It Sy x
+Archived log files should be compressed with
+.Xr xz 1
+to save space.
 .It Sy z
 Archived log files should be compressed with
 .Xr gzip 1

Index: src/usr.bin/newsyslog/newsyslog.c
diff -u src/usr.bin/newsyslog/newsyslog.c:1.59 src/usr.bin/newsyslog/newsyslog.c:1.60
--- src/usr.bin/newsyslog/newsyslog.c:1.59	Fri Aug 21 04:20:19 2009
+++ src/usr.bin/newsyslog/newsyslog.c	Sat Jun 16 23:52:32 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: newsyslog.c,v 1.59 2009/08/21 08:20:19 manu Exp $	*/
+/*	$NetBSD: newsyslog.c,v 1.60 2012/06/17 03:52:32 christos Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Andrew Doran a...@netbsd.org
@@ -55,7 +55,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: newsyslog.c,v 1.59 2009/08/21 08:20:19 manu Exp $);
+__RCSID($NetBSD: newsyslog.c,v 1.60 2012/06/17 03:52:32 christos Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -121,6 +121,7 @@ static struct compressor compress[] =
 	{NULL, , , }, /* 0th compressor is no compression */
 	{/usr/bin/gzip, -f, .gz, Z},
 	{/usr/bin/bzip2, -9f, .bz2, J},
+	{/usr/bin/xz, -f, .xz, X},
 };
 
 #define _PATH_NEWSYSLOGCONF	/etc/newsyslog.conf
@@ -377,7 +378,7 @@ parse_cfgline(struct conf_entry *log, FI
 		case 'P':
 			log-flags |= CE_PLAIN0;
 			break;
-		case 'J': case 'Z':
+		case 'J': case 'X': case 'Z':
 			for (ziptype = __arraycount(compress); --ziptype; ) {
 if (*compress[ziptype].flag == qq)
 break;



CVS commit: src/usr.bin/newsyslog

2009-08-21 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Fri Aug 21 08:20:19 UTC 2009

Modified Files:
src/usr.bin/newsyslog: newsyslog.c

Log Message:
Reset ziptype on each line. Failure to do this caused any log file to
be compressed if it was listed after a line using Z or J flag. For
instance, we compressed log2 with the config file below:
/var/log/log1600  5100  *Z
/var/log/log2600  7100  *-


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.bin/newsyslog/newsyslog.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/newsyslog/newsyslog.c
diff -u src/usr.bin/newsyslog/newsyslog.c:1.58 src/usr.bin/newsyslog/newsyslog.c:1.59
--- src/usr.bin/newsyslog/newsyslog.c:1.58	Sat Jun 20 19:34:19 2009
+++ src/usr.bin/newsyslog/newsyslog.c	Fri Aug 21 08:20:19 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: newsyslog.c,v 1.58 2009/06/20 19:34:19 christos Exp $	*/
+/*	$NetBSD: newsyslog.c,v 1.59 2009/08/21 08:20:19 manu Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Andrew Doran a...@netbsd.org
@@ -55,7 +55,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: newsyslog.c,v 1.58 2009/06/20 19:34:19 christos Exp $);
+__RCSID($NetBSD: newsyslog.c,v 1.59 2009/08/21 08:20:19 manu Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -244,6 +244,7 @@
 
 	rv = -1;
 	line = NULL;
+	ziptype = 0;
 
 	/* Place the white-space separated fields into an array. */
 	do {



CVS commit: src/usr.bin/newsyslog

2009-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 20 19:34:20 UTC 2009

Modified Files:
src/usr.bin/newsyslog: newsyslog.c

Log Message:
PR/40274: Takahiro Kambe: P flag stops rotating files.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/usr.bin/newsyslog/newsyslog.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/newsyslog/newsyslog.c
diff -u src/usr.bin/newsyslog/newsyslog.c:1.57 src/usr.bin/newsyslog/newsyslog.c:1.58
--- src/usr.bin/newsyslog/newsyslog.c:1.57	Mon Feb 16 21:56:43 2009
+++ src/usr.bin/newsyslog/newsyslog.c	Sat Jun 20 15:34:19 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: newsyslog.c,v 1.57 2009/02/17 02:56:43 dogcow Exp $	*/
+/*	$NetBSD: newsyslog.c,v 1.58 2009/06/20 19:34:19 christos Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Andrew Doran a...@netbsd.org
@@ -55,7 +55,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: newsyslog.c,v 1.57 2009/02/17 02:56:43 dogcow Exp $);
+__RCSID($NetBSD: newsyslog.c,v 1.58 2009/06/20 19:34:19 christos Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -536,6 +536,25 @@
 		}
 	}
 
+	/*
+	 * If a historical log file isn't compressed, and 'z' has been
+	 * specified, compress it.  (This is convenient, but is also needed
+	 * if 'p' has been specified.)  It should be noted that gzip(1)
+	 * preserves file ownership and file mode.
+	 */
+	if (ziptype) {
+		for (i = 0; i  log-numhist; i++) {
+			snprintf(file1, sizeof(file1), %s.%d, log-logfile, i);
+			if (lstat(file1, st) != 0)
+continue;
+			snprintf(file2, sizeof(file2), %s%s, file1,
+			compress[ziptype].suffix);
+			if (lstat(file2, st) == 0)
+continue;
+			log_compress(log, file1);
+		}
+	}
+
 	/* Move down log files. */
 	for (i = log-numhist - 1; i  0; i--) {
 		for (j = 0; j  (int)__arraycount(compress); j++) {
@@ -563,24 +582,6 @@
 err(EXIT_FAILURE, %s, file2);
 	}
 
-	/*
-	 * If a historical log file isn't compressed, and 'z' has been
-	 * specified, compress it.  (This is convenient, but is also needed
-	 * if 'p' has been specified.)	It should be noted that gzip(1)
-	 * preserves file ownership and file mode.
-	 */
-	if (ziptype) {
-		for (i = (log-flags  CE_PLAIN0) != 0; i  log-numhist; i++) {
-			snprintf(file1, sizeof(file1), %s.%d, log-logfile, i);
-			if (lstat(file1, st) != 0)
-continue;
-			snprintf(file2, sizeof(file2), %s%s, file1,
-			compress[ziptype].suffix);
-			if (lstat(file2, st) == 0)
-continue;
-			log_compress(log, file1);
-		}
-	}
 	log_get_format(log);
 	log_trimmed(log);