Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144568057
D43466.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
6 KB
Referenced Files
None
Subscribers
None
D43466.diff
View Options
diff --git a/usr.sbin/newsyslog/newsyslog.8 b/usr.sbin/newsyslog/newsyslog.8
--- a/usr.sbin/newsyslog/newsyslog.8
+++ b/usr.sbin/newsyslog/newsyslog.8
@@ -14,7 +14,7 @@
.\" the suitability of this software for any purpose. It is
.\" provided "as is" without express or implied warranty.
.\"
-.Dd December 22, 2023
+.Dd September 1, 2025
.Dt NEWSYSLOG 8
.Os
.Sh NAME
@@ -24,7 +24,6 @@
.Nm
.Op Fl CFNPnrsv
.Op Fl a Ar directory
-.Op Fl c Ar none Ns | Ns Ar legacy Ns | Ns Ar bzip2 Ns | Ns Ar gzip Ns | Ns Ar xz Ns | Ns Ar zstd
.Op Fl d Ar directory
.Op Fl f Ar config_file
.Op Fl S Ar pidfile
@@ -79,25 +78,6 @@
The following options can be used with
.Nm :
.Bl -tag -width indent
-.It Fl c Ar none Ns | Ns Ar legacy Ns | Ns Ar bzip2 Ns | Ns Ar gzip Ns | Ns Ar xz Ns | Ns Ar zstd
-Instructs
-.Nm
-to use the specified compression method when a file is flagged for compression.
-The default method is
-.Dq legacy ,
-which interprets the
-.Sy J, X, Y, Z
-flags in the configuration file according to their historical meanings.
-This default setting can be overridden by specifying
-.Fl c Ar none ,
-which causes
-.Nm
-to ignore all compression flags.
-Alternatively, specifying one of the compression methods:
-.Sy bzip2 , gzip , xz ,
-or
-.Sy zstd ,
-will apply the chosen method to all files flagged for compression.
.It Fl f Ar config_file
Instruct
.Nm
diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c
--- a/usr.sbin/newsyslog/newsyslog.c
+++ b/usr.sbin/newsyslog/newsyslog.c
@@ -701,19 +701,12 @@
hostname_shortlen = strcspn(hostname, ".");
/* Parse command line options. */
- while ((ch = getopt(argc, argv, "a:c:d:f:nrst:vCD:FNPR:S:")) != -1)
+ while ((ch = getopt(argc, argv, "a:d:f:nrst:vCD:FNPR:S:")) != -1)
switch (ch) {
case 'a':
archtodir++;
archdirname = optarg;
break;
- case 'c':
- if (!parse_compression_type(optarg, &compress_type_override)) {
- warnx("Unrecognized compression method '%s'.", optarg);
- usage();
- }
- compress_type_set = true;
- break;
case 'd':
destdir = optarg;
break;
@@ -858,26 +851,10 @@
static void
usage(void)
{
- int i;
- char *alltypes = NULL, *tmp = NULL;
-
- for (i = 0; i < COMPRESS_TYPES; i++) {
- if (i == COMPRESS_NONE) {
- (void)asprintf(&tmp, "%s|legacy", compress_type[i].name);
- } else {
- (void)asprintf(&tmp, "%s|%s", alltypes, compress_type[i].name);
- }
- if (alltypes)
- free(alltypes);
- alltypes = tmp;
- tmp = NULL;
- }
fprintf(stderr,
- "usage: newsyslog [-CFNPnrsv] [-a directory] [-c %s]\n"
- " [-d directory] [-f config_file]\n"
- " [-S pidfile] [-t timefmt] [[-R tagname] file ...]\n",
- alltypes);
+ "usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory] [-f config_file]\n"
+ " [-S pidfile] [-t timefmt] [[-R tagname] file ...]\n");
exit(1);
}
diff --git a/usr.sbin/newsyslog/newsyslog.conf.5 b/usr.sbin/newsyslog/newsyslog.conf.5
--- a/usr.sbin/newsyslog/newsyslog.conf.5
+++ b/usr.sbin/newsyslog/newsyslog.conf.5
@@ -18,7 +18,7 @@
.\" the suitability of this software for any purpose. It is
.\" provided "as is" without express or implied warranty.
.\"
-.Dd November 11, 2024
+.Dd September 1, 2025
.Dt NEWSYSLOG.CONF 5
.Os
.Sh NAME
@@ -44,8 +44,7 @@
normally
.Pa /etc/newsyslog.conf ,
to determine which logs may potentially be rotated and archived.
-Each line has five mandatory fields and four optional fields,
-separated with whitespace.
+.Pp
Blank lines or lines beginning with
.Ql #
are ignored.
@@ -63,34 +62,73 @@
is removed and
.Ql #
is treated as an ordinary character.
+.Pp
+The special
+.Dq Ar <compress>
+and
+.Dq Ar <include>
+lines are defined as follows:
+.Bl -tag -width indent
+.It Ar <compress> Ns Ar none Ns | Ns Ar legacy Ns | Ns Ar bzip2 Ns | Ns Ar gzip Ns | Ns Ar xz Ns | Ns Ar zstd
+This special option sets the global compress method,
+it should be placed before all log file entries in
+.Nm
+configuration file.
+The global compress method applies to all log files flagged as
+compressible
+.Dq Sy J ,
+.Dq Sy X ,
+.Dq Sy Y ,
+.Dq Sy Z
+.Ar flags
+below.
+.Pp
+The following compression methods are available:
+.Bl -tag -width indent
+.It Cm none
+No compression is performed, even when a log file is marked as
+compressible. This is useful for filesystems that have native
+compression support.
+.It Cm legacy
+Interprets the
+.Sy J, X, Y, Z
+flags in the configuration file according to their historical meanings.
+This is the default method.
+.It Cm bzip2
+Use
+.Xr bzip2 1
+for all compressible log files.
+.It Cm gzip
+Use
+.Xr gzip 1
+for all compressible log files.
+.It Cm xz
+Use
+.Xr xz 1
+for all compressible log files.
+.It Cm zstd
+Use
+.Xr zstd 1
+for all compressible log files.
+.El
+.It Ar <include>
+The special <include> entry is used to include other configuration
+files and supports globbing.
+.El
+.Pp
+Each other line has five mandatory fields and four optional fields,
+separated with whitespace.
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,
-or one of the special strings
-.Dq Li <compress> ,
-.Dq Li <default> ,
-or
-.Dq Li <include> .
-The <compress> entry,
-which should be placed at the beginning of the
-.Nm
-configuration file,
-sets the global compress method.
-This method is applied when a log file is flagged as
-compressible,
-which has the same effect of passing a compress method to the
-.Fl c
-option on the
-.Xr newsyslog 8
-command line.
+or the special string
+.Dq Ar <default> .
The special <default> entry will only be used if a log file
name is given as a command line argument to
.Xr newsyslog 8 ,
and if that log file name is not matched by any other
line in the configuration file.
-The include entry is used to include other configuration
-files and supports globbing.
.It Ar owner : Ns Ar group
This optional field specifies the owner and group for the archive file.
The
@@ -432,7 +470,7 @@
.El
.Sh EXAMPLES
The following is an example of the
-.Dq Aq Li include
+.Dq <include>
entry:
.Dl "<include> /etc/newsyslog-local.conf"
.Sh SEE ALSO
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 10, 4:39 PM (16 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28628219
Default Alt Text
D43466.diff (6 KB)
Attached To
Mode
D43466: newsyslog(8): Remove -c command line option.
Attached
Detach File
Event Timeline
Log In to Comment