History log of /freebsd-10.0-release/usr.sbin/newsyslog/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


252378 29-Jun-2013 kientzle

Fix -Wunsequenced

Submitted by: dt71@gmx.com


251240 02-Jun-2013 markj

We want to stat the archived log file rather than the logfile itself.

PR: bin/179122
Submitted by: Oliver Fromme <olli@secnetix.de>
MFC after: 3 days


250545 12-May-2013 markj

Some filesystems (NFS in particular) do not fill out the d_type field when
returning directory entries through readdir(3). In this case we need to
obtain the file type ourselves; otherwise newsyslog -t will not be able to
find archived log files and will fail to both delete old log files and to
do interval-based rotations properly.

Reported by: jilles
Reviewed by: jilles
MFC after: 2 weeks


248776 26-Mar-2013 markj

Fix interval-based rotations when the -t flag is used. In this case, find
the most-recently archived logfile and use its mtime to determine whether
or not to rotate, as in the non-timestamped case.

Previously we would just try to use the mtime of <logfile>.0, which always
results in a rotation since it generally doesn't exist in the -t case.

PR: bin/166448
Approved by: emaste (co-mentor)
Tested by: Marco Steinbach <coco executive-computing.de>
MFC after: 2 weeks


245963 27-Jan-2013 markj

Rename the run_cmd field to sw_runcmd to make it consistent with the
other fields in struct sigwork_entry.

Approved by: rstone (co-mentor)
MFC after: 1 week


245962 27-Jan-2013 markj

Ensure that newsyslog -n prints the correct message for a rotation rule
that uses the 'R' flag.

Reviewed by: gad
Approved by: rstone (co-mentor)
MFC after: 1 week


245961 27-Jan-2013 markj

When the 'R' flag is used with a newsyslog.conf entry, some fields of
the corresponding struct sigwork_entry were left uninitialized,
potentially causing an early return from do_sigwork(). Ensure that these
fields are initialized, and handle the 'R' flag properly in
do_sigwork().

PR: bin/175330
Reviewed by: gad
Approved by: rstone (co-mentor)
MFC after: 1 week


244997 03-Jan-2013 markj

Make sure to update the mtime of a logfile after archiving it. This
ensures that the next rotation happens at the correct time when using
interval-based rotations.

PR: bin/174438
Reviewed by: gad
Approved by: rstone (co-mentor)
MFC after: 1 week


244996 03-Jan-2013 markj

Have -n imply -r, since dry-run mode obviously doesn't require root
privileges.

Approved by: rstone (co-mentor)
MFC after: 1 week


244995 03-Jan-2013 markj

Fix a typo in an error message.

Approved by: rstone (co-mentor)
MFC after: 1 week


241777 20-Oct-2012 ed

More -Wmissing-variable-declarations fixes.

In addition to adding missing `static' keywords:
- bin/dd: Pull in `extern.h' to guarantee consistency with source file.
- libexec/rpc.rusersd: Move shared globals into an extern.h.
- libexec/talkd: Move `debug' and `hostname' into extern.h.
- usr.bin/cksum: Put counters in extern.h, as they are used by ckdist/mtree.
- usr.bin/m4: Move `end_result' into extern.h.
- usr.sbin/services_mkdb: Move shared globals into an extern.h.


238281 09-Jul-2012 ae

We don't need to check the result of sending signal when -R option is
specified.

Submitted by: Ilya A. Arkhipov
MFC after: 1 week


236805 09-Jun-2012 joel

mdoc: fix mandoc "Oc breaks Op" warning.


236509 03-Jun-2012 joel

Minor spelling fixes.


235647 19-May-2012 gleb

Hide DIR definition by making it an opaque struct typedef.

Introduce dirfd() libc exported symbol replacing macro with same name,
preserve _dirfd() macro for internal use.

Replace dirp->dd_fd with dirfd() call. Avoid using dirfd as variable
name to prevent shadowing global symbol.

Sponsored by: Google Summer Of Code 2011


233648 29-Mar-2012 eadler

Remove trailing whitespace per mdoc lint warning

Disussed with: gavin
No objection from: doc
Approved by: joel
MFC after: 3 days


233258 21-Mar-2012 glebius

Fix a sentence in a paragraph that describes time and interval based
trimming. This sentence vaguely can be interpreted as if it was speaking
about time and size interaction, while it wasn't about it.


233257 21-Mar-2012 glebius

Don't run through time checks when entry is definitely oversized. This
leads to newsyslog rotating on (size OR time) if both are specified.

PR: 100018, 160432


229654 05-Jan-2012 uqs

Further fix a typo and spelling classic correctly in function names,
too.

Submitted by: Ben Kaduk <minimarmot@gmail.com>


229403 03-Jan-2012 ed

Replace index() and rindex() calls with strchr() and strrchr().

The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.


228990 30-Dec-2011 uqs

Spelling fixes for usr.sbin/


228790 21-Dec-2011 eadler

- Remove extraneous null ptr deref checks
- Fix memory leak

Submitted by: Slono Slono <slonoman2011@yandex.ru>
Approved by: jhb
MFC after: 1 week


221873 14-May-2011 sobomax

Add new modifier - "R", when it is specified the path to pid file
will be considered as a path to a binary or a shell script to be executed
after rotation has been completed instead of sending signal to the process
id in that file.

Sponsored by: Sippy Software, Inc.
From the: FreeBSD hacking lounge at BSDCan


220926 21-Apr-2011 simon

Fix an old bug in newsyslog where we kept one log file more than was
requested in newsyslog.conf. This was only the case using the non-time
based filenames (.0, .1, .2 etc.).

The change also makes newsyslog clean clean up the old extra logfile so
users don't end up with a single stale logfile which won't be rotated
out.

This change also cleans up some code a bit to avoid more copy / paste
code and removes some old copy / paste code in the process.

PR: bin/76697
MFC after: 2 weeks


220015 26-Mar-2011 dougb

Add an example for the use of the <include> entry to help others
who are as slow as I am.

Discussed with: gordon


219434 09-Mar-2011 ru

Sync manpage's SYNOPSIS with program's usage.


218944 22-Feb-2011 sobomax

Make code more friendly to the non-C99 compilers - don't allocate
local variables in the `for' loop declaration. This allows trunk
newsyslog.c to be compiled on 7.x. This change should be no-op from
the functional POV.


218128 31-Jan-2011 mm

Use correct alphabetical order for xz(1) in SEE ALSO section
of newsyslog manpages.

Reported by: maxim
MFC after: 3 weeks


218127 31-Jan-2011 mm

Add xz(1) support to newsyslog.
Rewrite and simplify logfile compression code.

Approved by: gad
MFC after: 3 weeks


216832 31-Dec-2010 brian

Make -S functional.

MFC after: 1 week


215625 21-Nov-2010 simon

Fix a typo in a comment.

MFC after: 3 days


210407 23-Jul-2010 brian

Add a -S switch to override the default syslog pid file. This can be useful
if syslogd's -P switch or a syslogd alternative is being used.

MFC after: 3 weeks


210372 22-Jul-2010 simon

Add support for creating the archived log filenames using a time-stamp
instead of the traditional simple counter.

Using the time-stamp based file-names, once a log file is archived, it
will not change name until it is deleted. This means that many backup
systems will only perform one backup of the archived log file, instead
for performing a new backup of the logfile upon each logfile rotation.

This implementation is separate from the patches in the mentioned PR,
as I wasn't aware of the existence of the PR until after I had
implemented the same functionality as the patches in the PR provide.
Unlike the PR, this new code does honor the 'log count' in
newsyslog.conf so old logfiles are deleted. This new code does not
currently support never deleting the archived logfiles.

PR: bin/29363
MFC after: 3 weeks


208649 29-May-2010 gordon

Add file include processing for newsyslog.

Format for the include line in /etc/newsyslog.conf is:
<include> /etc/defaults/newsyslog.conf

Other notes of interest:
Globbing is supported in <include> statements.
Properly detect circular include loop dependencies.

Reviewed by: gad@
Approved by: wes@ (mentor)
MFC after: 2 months


208648 29-May-2010 gordon

Convert newsyslog to using queue(3) macros instead of a home rolled version.

Reviewed by: gad@
Approved by: wes@ (mentor)
MFC after: 2 months


208028 13-May-2010 uqs

mdoc: move remaining sections into consistent order

This pertains mostly to FILES, HISTORY, EXIT STATUS and AUTHORS sections.

Found by: mdocml lint run
Reviewed by: ru


202668 20-Jan-2010 delphij

Add a new option, -P, which reverts newsyslog(8) to the old behavior,
which stops to proceed further, as it is possible that processes which
fails to create PID file get screwed by rotation.

Requested by: stas
MFC after: 2 weeks
X-MFC with: r200806


201390 02-Jan-2010 ed

The last big commit: let usr.sbin/ use WARNS=6 by default.


200806 21-Dec-2009 delphij

Don't consider non-existence of a PID file an error, we should be able
to proceed anyway as this most likely mean that the process has been
terminated.

PR: bin/140397
Submitted by: Dan Lukes <dan obluda cz>
MFC after: 1 month


180019 26-Jun-2008 sobomax

Fix 6-year old cut&paste error. The # could be escaped with '\', not
with '\\'.

MFC after: 2 weeks


175837 30-Jan-2008 delphij

Fix two typos.


173971 27-Nov-2007 remko

s/effect/affect/

PR: docs/118266
Submitted by: "Kim Scarborough" <sluggo at unknown dot nu>
MFC After: 3 days


162806 29-Sep-2006 ru

Markup fixes.


161412 17-Aug-2006 delphij

Use same signedness for i and matched_c. This should make
newsyslog(8) WARNS=6 clean.


160560 21-Jul-2006 sobomax

Remove mention of the `W' flag, which has been turned to no-op by the
neworder change. Keep the option in a config file parser, to not
violate POLA.

MFC after: 2 weeks


159998 27-Jun-2006 gad

Remove the last three calls to strncpy(), two of which would have
been bugs if the source had ever been too big for the destination.

MFC after: 3 weeks


159968 27-Jun-2006 gad

Remove the "oldorder" processing. The "neworder" processing has
been the default for two years now, without any problems reported.

MFC after: 3 weeks


154566 20-Jan-2006 gad

Improve error-handling related to the fork() done to compress files after
they have been rotated. Among other things, use warnx() instead of warn()
for some messages where the value if errno is irrelevant to the problem
being reported.

MFC after: 5 days


152980 01-Dec-2005 sobomax

Fix logic error which causes <null> to be printed instead of the
actual file name in error message.

MFC After: 2 weeks


147377 14-Jun-2005 ru

Markup fixes.

Approved by: re (blanket)


143106 03-Mar-2005 brooks

Add the -N option to not rotate any files. This is to be used in
cojunction with -C and is used by /etc/rc.d/newsyslog.

I forgot that this was in my perforce tree and not my running system and
thus committed a non-working newsyslog script.

Reported by: des
Pointy hat: brooks


142365 24-Feb-2005 trhodes

Add a HISTORY section.

PR: 75282


141846 13-Feb-2005 ru

Expand *n't contractions.


140566 21-Jan-2005 ru

Fixed xrefs.


140442 18-Jan-2005 ru

Sort sections.


139655 04-Jan-2005 delphij

Because the `permission' field in conf_entry is intended to be used as
parameter 2 in chmod(2), which is a mode_t (and in turn a __uint_16_t),
it's more likely that it should be defined as an unsigned variable.

This commit should make newsyslog WARNS=6 clean, but don't bump the knob
until I have a universe build.

MFC After: 1 month


136186 06-Oct-2004 brooks

Mention "-d directory" in usage().

Pointy hat to: brooks


136174 05-Oct-2004 brooks

Don't prepend the directory specified by -d when the file is a relative
path. Doing so makes no sense. I'm not sure allowing relative paths
makes sense either, but I'm not going to break that now.


136127 04-Oct-2004 brooks

Add a new -d argument which is used to specify an alternate root for log
files similar to DESTDIR in the BSD make process. This only affects log
file paths not config file (-f) or archive directory (-a) paths.


131581 04-Jul-2004 sobomax

Nothing says that /var/log can't be not a directory but a symbolic link
to a directory. Therefore, use stat(2) instead of lstat(2) to check if
/var/log exists.

MFC after: 7 days


131500 02-Jul-2004 ru

Mechanically kill hard sentence breaks.


130794 20-Jun-2004 gad

Fix the format-string in a call to err(). It was causing a warning if
compiled on 4.x-stable.


130707 19-Jun-2004 gad

Fix the check for a "duplicate filename to compress", so that we're checking
the *filename* and not the pid_file(!). Stupid brain-fault on my part.
This could cause a segfault under -neworder if newsyslog had to rotate
multiple files, and later ones had specifed the 'N' flag.

Bug first reported by: le
MFC after: 3 days


130420 13-Jun-2004 ru

Assorted markup, grammar, and spelling fixes.


130385 12-Jun-2004 gad

Switch to using the "neworder" for rotating log files, by default. The
main advantage of this is that daemon's are only signalled once per run,
instead of once for each file that is rotated.

MFC after: 2 weeks


130214 07-Jun-2004 gad

Drop the include for <stdint.h>, it was only needed when this was
using __DECONST() for something, and that reference has been removed.

Noticed by: Helge Oldach
MFC after: 13 days


130205 07-Jun-2004 gad

Add an "oldorder" option, so that when the default changes to "neworder",
people have a way to drop back to the previous logic.

MFC after: 13 days


130204 07-Jun-2004 gad

In "neworder" processing, reduce the delay between signals to separate
processes, and balance that by adding a 10-second delay after all the
processes have been signaled. Also improvement a few messages printed
with `-n' or `-v' processing (mostly signal-related messages).

MFC after: 13 days


130167 07-Jun-2004 gad

Major re-ordering of the steps that newsyslog will use when processing
files to rotate. The new order will first rotate all files that need
to be rotated, and then send a single signal to each process which
needs to be signaled, and finally it will compress all the files which
were rotated.

This means daemons will be signaled once per run of newsyslog, instead
of once per file rotated. Also, files will be compressed in order of
file-size (smallest to largest). Also, it waits for each file to be
completely compressed before starting the next one (effectively as if
the 'w' flag is specified for all entries in newsyslog.conf). This
avoids the situation of having 10 gzip's going at the same time (each
with a log.0 and a log.0.gz file active), and it also means that file
attributes can be reliably set on files after they are compressed.

NOTE: This commit does define NEWORDER (which you could get rid of if
you really don't trust this), but it does not flip the "-D neworder"
switch. So, at the moment none of these changes happen unless you
request them (perhaps by adding '<debug> neworder' in newsyslog.conf).

PR: bin/25070 inspired some parts of this
Submitted by: parts from bin/25070 done by Helge Oldach
MFC after: 14 days


130165 07-Jun-2004 gad

A variety of minor changes. Allow users to set a debugging option via
the newsyslog.conf file. Rename one size-related variable, and move
another one from the stack into conf_entry. Add a routine to change
file-attributes (chown, chmod, chflags), instead of having several
places doing the same sequence of system-calls. A few cosmetic/style
changes.

These should not effect any users. Most of these probably look
pointless, but they are the "insignificant parts" of a much larger
update that I'll be committing soon. Doing these as a separate update
should make that update easier to read.

MFC after: 14 days


130045 03-Jun-2004 gad

Style-istic fix to a number of #define's that were not followed by a tab...

MFC after: 16 days


130043 03-Jun-2004 gad

Add a 'D' flag that can be specified on entries in newsyslog.conf.
If specified, the matching log files will have the NODUMP flag set
on them after they are created.

Submitted by: Sean Eric Fagan
MFC after: 16 days


130038 03-Jun-2004 gad

Change standard processing to use the newer createlog() routine
that had been written some months ago for other processing. This
should get rid of a few subtle situations where an existing log
file would not exist (for a short time) while it is being rotated.

MFC after: 16 days


129975 02-Jun-2004 gad

Improved versions of the is*ch() and tolowerch() macros that I like to use.


129974 02-Jun-2004 gad

When rotating some "blah.log" file, make sure that a chmod and
(if requested) a chown is done on the "blah.log.0" file.

PR: bin/67137
Submitted by: jeh
MFC after: 10 days


127858 04-Apr-2004 charnier

Do not :-terminate err(3) string, one will be added anyway.


126878 12-Mar-2004 trhodes

Move newsyslog.conf.5 to usr.sbin/newsyslog. There is no real history
other than 'initial revision' thus I did not request a repocopy.

Requested by: ru, gad


126830 11-Mar-2004 trhodes

Remove information about the configuration file.
Add an Xref to newsyslog.conf.5 and bzip2.1.


120726 04-Oct-2003 gad

Handle a 'const' parameter without using __DECONST().

MFC after: 14 days


120361 23-Sep-2003 gad

Restructure the time processing routines, mainly to fix up the
"will trim at" message printed when the user requests '-v'. The
previous code would often print the wrong time, such as:
On Sept 22, run: newsyslog -nv /var/log/wtmp
And see: will trim at Mon Sep 1 05:00:00 2003
correct msg: will trim at Wed Oct 1 05:00:00 2003

MFC after: 20 days


120046 14-Sep-2003 gad

Correct the calculation of "a leap year" in parseDWM. The calculation
would only match a leap year every 400 years. The parseDWM code first
showed up in April 2000, so the first time this bug would cause any
confusion is in Feb 2004.

MFC after: 18 days


119998 12-Sep-2003 gad

Move the parse8601 and parseDWM routines into a new ptime.c file. The
only code-change is to add a "next_time" parameter to both routines (and
that is not used yet). A later update will make "next_time" more useful.

MFC after: 20 days


119927 09-Sep-2003 gad

Switch dotrim() to take advantage of the 'struct conf_entry' that
is already passed in, instead of having the caller copy values from
that struct into additional parameters.

MFC after: 22 days


119926 09-Sep-2003 gad

Reduce the annoying compiler warnings that pop up when compiling with
gcc 3.3.x and -Wshadow. Just renames 'log' variables to be 'logname'.

MFC after: 22 days


119905 09-Sep-2003 gad

Correct the comment about which timezone-change loses an hour...

MFC after: 23 days


119904 09-Sep-2003 gad

Add a '-D <something>' command line arg, which can be used to set
debugging options. Initial option is '-D TN=<time>', which can be
used to see how newsyslog would work if run at the specified time.
(time format is ISO 8601, since that is already supported).

MFC after: 23 days


119902 09-Sep-2003 gad

Use strtol() instead of strtoul() in parse8601, so we can detect
negative values. Mainly done to sync this routine with OpenBSD.

Obtained from: OpenBSD
MFC after: 23 days


119901 09-Sep-2003 gad

Fix typo in the previous commit. Was checking wrong variable...

MFC after: 23 days


119899 09-Sep-2003 gad

Change parse8601 and parseDWM so they return an alternate error value
for invalid times, and have the caller print the error message.

MFC after: 23 days


119897 09-Sep-2003 gad

Cosmetic change to move parse8601 right next to parseDWM. No code
is changed. (that will come in later updates).

MFC after: 23 days


119102 19-Aug-2003 gad

When checking the 'user:group' field in newsyslog.conf, freebsd's source
was mistakenly calling the standard isnumber() function to find out if
the given 'user' or 'group' were all numeric. This meant that only the
first character of the fields were actually checked, so a username of
(say) '3com' would look like a number, and thus get mapped to uid=3 (bin)
instead of username=3com.

This bug was introduced back in freebsd's v1.1. That initial import
almost matches netbsd's v1.9, except that an internal isnumber()
routine was removed in favor of the standard library version. The thing
is, that internal routine was checking the entire string, and not just
the first digit. In OpenBSD, isnumber() was eventually renamed to
isnumberstr() to make the distinction more obvious, and I'm going to
follow that lead.

I believe this also happens to remove the last references to isnumber()
in the entire freebsd base system.

Obtained from: OpenBSD, by a long circuitous route
MFC after: 5 days


118370 02-Aug-2003 gad

Fix an 'bad file descriptor' error which would come up when using
the 'C' flag on an entry that also specifies 'user:group' info.

Submitted by: Riccardo Torrini <riccardo@torrini.org> in -current
MFC after: 4 days


114764 05-May-2003 gad

Fix age_old_log checking so that it will notice log files which were
rotated and then compressed with bzip2 instead of gzip. Otherwise,
any file which had a time-interval specified for 'when' and also
specified the 'J' flag would be rotated every time newsyslog was run.
(this is a quick-fix, trying to beat the code-freeze for 5.1-release)

PR: bin/51519
MFC after: 1 week


114762 05-May-2003 gad

Slightly improve the checking of the 'size' field, so people will get
a warning message if they switch the values for 'size' and 'when'.

MFC after: 1 week


114601 03-May-2003 obrien

Use __FBSDID over rcsid[]. Protect copyright[] where needed.


114137 27-Apr-2003 gad

Add a -C (create) option for newsyslog, and a 'C' flag for entries in the
config file. If the -C option is specified once, then newsyslog will create
any entries which specify the 'C' option. If -C is given twice, then
newsyslog will create all missing log files. Some of this code comes
from NetBSD, although this implementation does not exactly match theirs.

Reviewed by: freebsd-arch
MFC after: 10 days


113988 24-Apr-2003 gad

Document support for the new 'U' flag, which was implemented back in March
as revision 1.64 of newsyslog.c. I plan to MFC these changes next week.

MFC after: 1 week


113952 24-Apr-2003 gad

Document support for the new -s and -R command-line options, and
the 'N' flag. These were coded in March as revisions 1.55 and 1.56
of newsyslog.c. I intend to MFC all the matching changes next week.
This also reorganizes the description of the 'flags' field to give
list of the valid flags, instead of a long paragraph explaining
each of the possible values.

Obtained from: NetBSD (in spirit at least, for -s and N)
MFC after: 1 week


113939 23-Apr-2003 gad

Document support for the <default> entry, which was implemented in
revision 1.50 of newsyslog.c , back in February. I intend to MFC
those changes soon.

MFC after: 4 days


112020 09-Mar-2003 gad

Fix interactions between entries for a specific file vs entries for
a filename pattern, and also wrt filenames given on the command line.
Now if a file is listed as a specific entry, it will not *also* be
processed by an entry specifying a pattern. And filename-patterns
will now only match existing files (ignoring directories, etc).

MFC after: 3 weeks


112013 09-Mar-2003 gad

The processing of files given on the command-line will work a little better
if we return the entire worklist, instead of just the last entry. A minor
fix to revision 1.57.

MFC after: 15 days


112003 08-Mar-2003 gad

Add a config-file flag of 'U' or 'u' to indicate that the pid-file
will contain the pid for a process group. This means the file must
contain a negative value (as would be needed in the 'kill' commmand).
I still need to write man-page update before MFC-ing.

This started by rewriting the get_pid() routine. Later I looked at
what OpenBSD has, and included a few ideas from their send_signal()
routine. So, parts of this change are from OpenBSD, even though
OpenBSD does not actually have a 'U' flag.

PR: bin/28435
Reviewed by: no objections on freebsd-arch
MFC after: 3 weeks


111967 07-Mar-2003 gad

Prefix all -n (noaction) "unix cmds" with tab, thus making it much easier
to sort out noaction messages from -v (verbose) messages. This also
improves a few noaction messages.

Obtained from: OpenBSD
MFC after: 3 weeks


111966 07-Mar-2003 gad

Move the -s (nosignal) processing, as newsyslog needs to print out a
warning message if -s is specified and it rotates a file that expects
to be compressed. This warning message is not printed if -R is also
specified, because we assume a -sR request is coming from the process
which would have been signaled, and that it has already released the
logfile.

Indirectly noticed by: sheldonh


111820 03-Mar-2003 gad

Add missing 'static' on two routines, so they match their declarations.

PR: 29363 (a small part of)
Submitted by: dinoex
MFC after: 3 weeks


111781 03-Mar-2003 gad

A variety of cosmetic changes, mostly to (slightly) reduce diffs with
OpenBSD. Except for one added '\n', the object code is not changed.

MFC after: 3 weeks


111780 03-Mar-2003 gad

Collapse two more parameters to dotrim() into the 'ent' parameter that is
already there. This should not effect anything.

MFC after: 3 weeks


111779 03-Mar-2003 gad

Change to using uid_t and gid_t instead of int. Also change this won't
bother doing a chmod() if neither of these two fields are set.

Obtained from: OpenBSD
MFC after: 3 weeks


111773 03-Mar-2003 gad

Fix the interactions between specific log files given on the command line,
and config-file entries which specify a filename-pattern (glob). It is
still not perfectly-right, but at least it isn't completely-wrong.

Reviewed by: no objections on freebsd-arch
MFC after: 3 weeks
MFC addendum: (or after the code-freeze of 4.x is lifted)


111772 02-Mar-2003 gad

Add a command-line option of '-R somename', which indicates that newsyslog
should rotate all files given on the command, even if they don't seem to
need to be rotated. This would be used by some other command that decides
the given log file(s) should be rotated, but wants the "how" of that rotation
to be determined by entries to newsyslog. Wes expects to change syslogd to
take advantage of this. Man page will be updated after we're sure this is
all working the way we want it to.

Reviewed by: no objections on freebsd-arch
MFC after: 3 weeks
MFC addendum: (or after the code-freeze of 4.x is lifted)


111768 02-Mar-2003 gad

Add a command-line option of '-s', which indicates that newsyslog should
not send a signal to any processes. Also add a config-file flag of 'N' or
'n', which indicates that the given logfile has no process which needs a
signal when it is rotated. Both of these are based on changes NetBSD
has made, although the implementation is somewhat different.

PR: bin/36553 (2nd half)
Reviewed by: no objections on freebsd-arch
Obtained from: NetBSD (in spirit, at least)
MFC after: 3 weeks


111529 26-Feb-2003 gad

Fix an error which caused 'free(): error: chunk is already free'
if an entry in the config file included flag 'G'.

MFC after: 3 weeks


111400 24-Feb-2003 gad

Check the value given for number-of-logs to keep in config-file entries,
and error-out if the value is negative (avoiding an infinite loop).

PR: bin/30654 (part of it)
MFC after: 3 weeks


111398 24-Feb-2003 gad

1) Fix so -a honors the -n ("do nothing") option. Before, if the directory
given for -a did not exist, then newsyslog would always try to create
it, even if -n was specified.
2) When -a processing *does* create the directory, have it check the result
from mkdir(), and immediately error-out if that failed.

PR: bin/46974
MFC after: 3 weeks


111392 24-Feb-2003 gad

Minor style fix. Add parenthesis around 'return' values.

Reviewed by: md5
MFC after: 3 weeks


111388 24-Feb-2003 gad

Add the idea of a "default rotate action", which will be used if a file is
specified at runtime, but that filename is not listed in the newsyslog.conf
file. This default-action can be changed by having a line in newsyslog.conf
with the filename of "<default>". Before this change, the program would
quietly ignore the given file. An update to the man page will be written
after I finish some other updates to newsyslog.c.

Reviewed by: no objections from freebsd-arch
MFC after: 3 weeks


108317 27-Dec-2002 schweikh

english(4) police.


108164 21-Dec-2002 trhodes

Make newsyslog(8) print the correct date when the logs are turned over.

PR: 46395
Submitted by: maxim
MFC: eventually


107916 15-Dec-2002 sobomax

Add a new `W' flag, that when used in conjunction with the `Z' flag or the
`J' flag means that newsyslog should wait for previously started compression
jobs to complete before starting a new one for this entry. When it is used
along with the `G' flag, in the case when several logfiles match the pattern
and should be compressed, the newsyslog will compress logs one by one,
ensuring that only one compression job is running at a time.

This prevents newsyslog(8) from overloading system by starting several
compression jobs on big files simultaneously.

Sponsored by: Porta Software Ltd
MFC after: 2 weeks


107738 11-Dec-2002 sobomax

Backout unapproved WARNS level change occasionally slipped into previous
commit.

Big pointy hat to: sobomax


107737 11-Dec-2002 sobomax

- Allow comments to be placed at the end of configuration line.

Sponsored by: Porta Software Ltd
Approved by: re
MFC after: 2 weeks


107312 27-Nov-2002 ru

mdoc(7) police: markup fixes.

Approved by: re


106905 14-Nov-2002 sobomax

Add a new newsyslog.conf flag - 'G', which if set tells newsyslog(8) that
the specified filename of the log to be rotated is in fact shell glob
pattern. In this case, all files matching this pattern will be rotated
using the same options. Useful in the case when there is no pre-defined
name for the logfiles (e.g. xtradius, samba etc).

Sponsored by: PortaOne Software Ltd
MFC after: 2 weeks


105248 16-Oct-2002 maxim

Fix getopt(3) optstring: remove a flag we does not handle.

PR: bin/44066
Submitted by: Stefan Farfeleder <e0026813@stud3.tuwien.ac.at>
MFC after: 1 week


99968 14-Jul-2002 charnier

The .Nm utility


99209 01-Jul-2002 maxim

Remove the last EOF spaces I missed in rev. 1.43.

MFC after: 1 week


96001 03-May-2002 maxim

style(9): sort includes, remove EOL spaces.

MFC after: 1 week


95999 03-May-2002 maxim

wait(2) for compress_log() processes to complete before exit.

Spotted by: Grigoriy Strokin <grg@isabase.philol.msu.ru>
Reviewed by: -current
MFC after: 1 month


94352 10-Apr-2002 sheldonh

Close a very small window during which new (empty) instances of rotated log
files are owned by the caller of newsyslog (usually root:wheel) even if
alternative ownerships were specified in newsyslog.conf.

Note that this is part of a wider problem which is fully addressed in
OpenBSD. Anyone with the time and inclination to incorporate the full
fix for the wider problem will receive no complaints from me and should
feel free to walk all over this delta.

PR: bin/36738
MFC after: 1 week


93659 02-Apr-2002 cjc

Produce a different error message for mktime(3) failure than for bad
newsyslog.conf syntax.

PR: bin/36641


90240 05-Feb-2002 roam

Fix -F with logfiles rotated on time only.

Approved by: silence on -audit
MFC after: 1 month


86360 14-Nov-2001 obrien

Fix the type of the NULL arg to execl().


83761 21-Sep-2001 ru

WARNS= -> WARNS?=


80742 31-Jul-2001 obrien

jhb says a 10 line change containing casts is more invasive than a 28 line
change.


80684 30-Jul-2001 obrien

Use the POSIX syntax for chown.

Submmited by: garrett


80666 30-Jul-2001 wollman

Simplify (and hopefully clarify) some date-parsing arithmetic.


80646 30-Jul-2001 obrien

style(9)


80640 30-Jul-2001 obrien

WARNS-2'ify.
(this included removing the funny "if (unsigned_var < 0)" test)


80638 30-Jul-2001 obrien

Add the ability to Bzip2 your logs.

PR: 27901
Submitted by: Anders Nordby <anders@fix.no> (stylistic changes by me)


80029 20-Jul-2001 obrien

Perform a major cleanup of the usr.sbin Makefiles.
These are not perfectly in agreement with each other style-wise, but they
are orders of orders of magnitude more consistent style-wise than before.


79966 19-Jul-2001 wollman

Note the equivalence of certain time formats.


79951 19-Jul-2001 dd

Instead of giving an example of rotating logs at the end of the month,
give an example of how to rotate logs at the beginning of the month.
Although they sound the same, since both of them rotate logs at the
beginning of the day, the former ended up taking place on, e.g., July
31 00:00 instead of the expected July 31 23:59. This is contraty to POLA.

Submitted by: Dan Langille <dan@langille.org>


79755 15-Jul-2001 dd

Remove whitespace at EOL.


79452 09-Jul-2001 brian

Fix the type of the NULL arg to execl()

Idea from: Theo de Raadt <deraadt@openbsd.org>


75079 02-Apr-2001 dd

Fix a grammar bogon.


74816 26-Mar-2001 ru

- Backout botched attempt to introduce MANSECT feature.
- MAN[1-9] -> MAN.


74532 20-Mar-2001 ru

Set the default manual section for usr.sbin/ to 8.


71898 01-Feb-2001 ru

mdoc(7) police: split punctuation characters + misc fixes.


71299 20-Jan-2001 jedgar

- Correct MAXPATHLEN/MAXHOSTNAMELEN usage
- Check return values of malloc() and strdup()
- Replace strcpy()/strcat()/sprintf() usage with strlcpy()/snprintf

Reviewed by: -audit


68965 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


64663 15-Aug-2000 joe

When warning that a log file can't be compressed, tell the reader which
log file it was.


60373 11-May-2000 des

Allow user to specify which logs to rotate


59004 04-Apr-2000 hm

- implement logfile archivation to a separate, user
configurable directory
- implement alternate and more flexible way to specify
logfile rotation time in addition to the ISO 8601
restricted format
- cleanup the source which was a mix of several styles
of persons who maintained it so far, ran through
knfom script got from bde.

Reviewed by: (in part) sheldonh and garyj


59003 04-Apr-2000 hm

Run newsyslog source through knfom script obtained from Bruce Evans.
Joerg Wunsch suggested to do this to make the functional changes in
the next commit to newsyslog (which were run through the same script)
better visible.


57673 01-Mar-2000 sheldonh

Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.


53760 27-Nov-1999 charnier

.Nm corrections


50479 28-Aug-1999 peter

$Id$ -> $FreeBSD$


49146 28-Jul-1999 obrien

Correctly refer to the companion program rather than as "chown".
Clean up wording a little (like I have any idea what real English looks like...)


49145 28-Jul-1999 obrien

Go back to allowing ``.'' as a username.group separator for backward
compatibility. : is still the documented non-ambiguous approach. The
algorithm used will correctly parse david.obrien.staff as strrchar() is
used, and in my mind more people would use a ``.'' in the username than
the group name.

Convinced by argument and patch by: sheldonh (with slight changes by me)


48295 28-Jun-1999 obrien

Syntax for user/group is changed from "user.group" to "user:group" to be
consistant with chown(8).


45547 10-Apr-1999 chuckr

Fix description of size, it's in kilobytes, not bytes.


43356 28-Jan-1999 wollman

jkoshy forgot up update the heading date on the man page.


43266 27-Jan-1999 jkoshy

Note that the 'owner.group' field is optional in the config file.

PR: docs/9602
Submitted by: Kazuo Horikawa <horikawa@jp.freebsd.org>


43071 22-Jan-1999 wollman

A slight bit of code and doco cleanup, but mostly:

Add the much-needed and long-desired ability to force the log rotation
to take place on a specific day or time, and document same. This works
by extending the syntax of the `when' field to allow a restricted
ISO 8601 time specification, and performing the log rotation if newsyslog
is run during the same hour as is specified.


42031 23-Dec-1998 peter

The largest PID is now 99999
Reported by: Ben Stuyts <ben@stuyts.nl>


39496 19-Sep-1998 obrien

Remove useless `BINOWN=root' now that it is the default.


36817 09-Jun-1998 ache

Add optional config file field: signal number to send (defaulted to HUP)
F.e. apache restarts less agressively on USR1 then on HUP


35920 10-May-1998 hoek

1) kill -HUP syslog, even if compressing supposedly "binary" files
PR: docs/6385

2) -n (noaction) does not imply -r (run as non-root), since as of
Rev. 1.12 (ache), -r changes actual behaviour.

3) missing \n from if(noaction) messages.


35917 10-May-1998 hoek

Arg! Someone fixed the synopsis in -stable's newsyslog.8, but not
in -current. However, they fixed both the ordering and the missing -F
flag. Merge from 22 and fix ordering here, too.


35915 10-May-1998 hoek

Fix the usage here, too (-F option).

Typo fix in comment ("Force the tim now matter what" s/tim/trim/)


35914 10-May-1998 hoek

1) Remove a line that somehow strayed from the one true path of
its sentence.
2) Fix usage (-F option).


34809 23-Mar-1998 charnier

.Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aq.


34584 14-Mar-1998 pst

Add "-F" (force) flag to newsyslog.
Submitted by: Terry Lambert <terry@freebsd.org>


31460 30-Nov-1997 ache

Sleep 10secs after kill -HUP instead of 3secs, some daemons like Apache
may have log time to re-configure


30160 06-Oct-1997 charnier

Cosmetic in err() strings.


26826 23-Jun-1997 steve

Show the real revision date and not the date that this
manpage is being viewed.


25518 06-May-1997 brian

Allow a '-' flag as a placeholder so that path_to_pid_file
can be specified without the flags field.
Fix bogus "trail" left in parse routine where the code jumps
past the end of the line and wanders into oblivion.


25496 05-May-1997 ache

Do not kill -HUP syslog if running in user mode (-r), it allows
private user logs rotation without error diagnostics


25443 04-May-1997 ache

1) Add yet one optional field: pid file to send SIGHUP to if log rotated
(good thing for apache f.e.) This change is backward compatible with old
newsyslog.conf files.

2) Do not compress log if SIGHUP sending failed for some reason
(f.e. pid file deleted). Newcoming messages will be lost
otherwise.

3) Misc cleanup while I am here.


24428 31-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


23189 28-Feb-1997 mpp

Add a missing period so that the -n option is display properly
in the man page output. Closes PR# 2831.

Submitted by: Marc Slemko <marcs@znep.com>


22997 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


20772 21-Dec-1996 mpp

Convert to mdoc format.


18188 09-Sep-1996 jkh

Doh! Actually read the patch I applied and see what it was *trying* to do,
then make it do that.
Error-of-my-ways-pointed-out-by: Bob Willcox <bob@luke.pmr.com>


18075 06-Sep-1996 jkh

PR#2724 in NetBSD notes that newsyslog save log files even if the number
of copies to save is zero. Incorporate suggested fix with some stylistic
cleanup to make the resulting code more readable.
Submitted-By: Kenneth Stailey <kstailey@dol-esa.gov>


16240 08-Jun-1996 alex

Added function prototypes and removed in-line prototypes of standard
functions such as malloc and time.


16174 07-Jun-1996 alex

Fix uninitialized variable that caused a core dump if /etc/newsyslog.conf
was empty. Closes PR bin/1300.

Found by: Brian Tao <taob@io.org>


13460 16-Jan-1996 graichen

Submitted by: charnier@lirmm.fr (Philippe Charnier)
1) correct MAX_PID according to system definition.
2) replace fprintf(stderr,...)/perror/exit by 4.4 equivalence.
3) make strings enough larger so they can't overflow: MAXHOSTNAMELEN for
host and MAXPATHLEN for filenames.
4) call execl with correct parameters (compress -> gzip).


13358 09-Jan-1996 graichen

Obtained from: NetBSD (PR#1906)
removed date formatting glitch in newsyslog


13245 05-Jan-1996 graichen

This commit was generated by cvs2svn to compensate for changes in r13244,
which included commits to RCS files with non-trunk default branches.