History log of /netbsd-current/usr.bin/newsyslog/newsyslog.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.62 01-Mar-2021 otis

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


Revision tags: netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.61 05-Sep-2013 prlw1

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)


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.60 17-Jun-2012 christos

branches: 1.60.2;
PR/46608: Jim Bernard: Add xz conversion "X"


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 matt-premerge-20091211
# 1.59 21-Aug-2009 manu

branches: 1.59.6;
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/log1 600 5 100 * Z
/var/log/log2 600 7 100 * -


# 1.58 20-Jun-2009 christos

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


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.57 17-Feb-2009 dogcow

Fix an embarrassing mistake regarding moving down log files. Reported by
(and fix included in) PR bin/40635 from Jukka Salmi.


# 1.56 29-Dec-2008 christos

branches: 1.56.2;
64 bit time_t


# 1.55 31-Oct-2008 christos

fix compilation issue


# 1.54 31-Oct-2008 christos

Import syslogd SoC project by Martin Schuette:
- new syslog protocol api syslogp(3) that supports structured data
and draft-rfc timestamps
- reliable tcp connections with queueing
- encrypted connections


Revision tags: netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 mjf-devfs2-base wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.53 21-Dec-2007 dogcow

branches: 1.53.10;
It doesn't seem worth it to keep pathnames.h around (especially when it has
non-static data)


# 1.52 21-Dec-2007 simonb

Fix some whitespace nits.


# 1.51 21-Dec-2007 dogcow

add new flag to newsyslog(5): J to bzip2 files.
There are no longer any hardcoded gzip-specific args, yay.
And while I was at it, compiles with -Wsigned, too.


# 1.50 15-Dec-2007 perry

convert __attribute__s to applicable cdefs.h macros


Revision tags: matt-armv6-prevmlocking cube-autoconf-base matt-mips64-base
# 1.49 22-Jul-2007 christos

branches: 1.49.4; 1.49.8;
WARNS=4, pass lint


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-4-base chap-midi-nbase netbsd-3-0-1-RELEASE chap-midi-base netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.48 30-Oct-2004 dsl

Add (unsigned char) cast to ctype functions


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.47 13-Oct-2003 lukem

Various fixes for when ngen is 0.


Revision tags: fvdl_fs64_base
# 1.46 30-Nov-2002 lukem

tweaks for fparseln(3) move from libutil to libc:
- remove #include <util.h> if nothing else needed it
- remove LDFLAGS+=-lutil if nothing else needed it


# 1.45 27-Jun-2002 itojun

don't let newsyslog follow symlink (could be abused to do tricks).
OpenBSD PR 1913.


# 1.44 19-Jun-2002 ad

Address PR 16291 by Markus W Kilbinger: newsyslog always compresses archived
log files.


Revision tags: netbsd-1-6-base
# 1.43 11-Feb-2002 wiz

branches: 1.43.2;
achive is not a good word.


# 1.42 10-Jun-2001 ad

Don't sleep before compressing if we didn't send a signal.


# 1.41 06-May-2001 ad

Sleep for 10 seconds before compressing the old log.


# 1.40 22-Mar-2001 ad

Get the correct signal type. Pointed out by Hauke Fath <hf@tangro.de> in
bin/12453, real fix by me.


# 1.39 18-Mar-2001 ad

If configured to rotate at a specfic time and no historical log exists, then
don't consider the age of the historical log.


# 1.38 21-Sep-2000 ad

New option, `-s': don't bother with PID files or signals.


# 1.37 22-Aug-2000 tron

Fixed reversed result test in call to chown(2) which caused bogus
error message.


# 1.36 22-Aug-2000 tron

Use vfork(2) instead of fork(2) to create child process for "gzip" and
wait until it terminates. Problem noted by Enami Tsugutomo on
"current-users@netbsd.org"


# 1.35 24-Jul-2000 ad

- Wrap line.
- Minor oops in a comment.


# 1.34 19-Jul-2000 ad

Simple const.


# 1.33 19-Jul-2000 enami

- Free storage allocated by fparseln.
- Handle comment only or empty line in the parser.


# 1.32 18-Jul-2000 ad

More work on newsyslog(8):

- Add some comments. It might be getting a little unclear what's going on.
- Make it useful as non-root.

Also, some new features taken from FreeBSD. The last two are not well
tested yet:

- Specifing log files on the command line limits operation to those files.
- Add cyclic time specification for periodic trimming.
- Add restricted ISO-8601 time specification for periodic trimming.


# 1.31 13-Jul-2000 ad

- Use _PATH_VARRUN.
- Address PR 10577 from mjl: recognise '.' as user/group seperator.


# 1.30 11-Jul-2000 ad

parse(): be sure to clear *log before filling.


# 1.29 11-Jul-2000 ad

- Detail flags in manpage using a table.
- Typo patrol.
- Add new flag, `p': keep zero'th historical log file uncompressed (plain).
Inspired by woods' newsyslog package.


# 1.28 10-Jul-2000 ad

Sorry about breakage - no connectivity at evenings or weekends for me. Anyway:

- Put back `-n' option. This is a slight improvement on its predecessor.
- More paranoid error checking.
- Fix miscellaneous buglets.


# 1.27 10-Jul-2000 assar

print size_t as casted to (u_long) with %lu


# 1.26 09-Jul-2000 aymeric

newsyslog wouldn't parse the count field because sscanf return value was
tested against the wrong value (0 != 1)


# 1.25 07-Jul-2000 ad

Back out previous two.


# 1.24 07-Jul-2000 ad

Redo previous slightly; add `-m' option to allow multiple instances.


# 1.23 07-Jul-2000 ad

Don't allow more than one instance when running as root.


# 1.22 07-Jul-2000 ad

Overhaul newsyslog(8). Changes:

- Code cleanup.
- Better flowing English in manpage (in places).
- `-n' option has been removed (was mainly a debugging convenience, I think).
- Add `C' flag: create log file if one doesn't exist.


Revision tags: netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.21 30-Nov-1999 ad

branches: 1.21.4;
- Add '-F' option which forces rotation of logs (from FreeBSD).
- Add 'sigtype' field specifying signal to be sent (from FreeBSD).
- Add 'N' flag which specifies that no signal should be sent.
- Fix some breakage.


Revision tags: comdex-fall-1999-base
# 1.20 06-Oct-1999 ad

Add a new optional parameter to the configuration file, specifying the
path to a file containing a PID to send SIGHUP to. If omitted, the default
is to signal syslogd. Idea from FreeBSD.


# 1.19 05-Oct-1999 ad

Allow use of use of ':' to separate user and group names, since elsewhere
'.' is a valid character in user and group names. '.' still works, but
':' takes priority.


# 1.18 30-Sep-1999 soren

Remove extraneous colons and newlines from perror(3) arguments.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.17 19-Dec-1998 christos

branches: 1.17.4;
char -> unsigned char and portable printf formats.


# 1.16 29-Jul-1998 simonb

Remove conditional strdup() compiled if OSF isn't defined, and -DOSF
from the Makefile to guarantee that the private version strdup() isn't
compiled in.


# 1.15 06-Jul-1998 mrg

- use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames


# 1.14 02-Apr-1998 kleink

Need <time.h> for time() and ctime() prototypes.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.13 19-Oct-1997 lukem

WARNSify, fix .Nm usage, getopt returns -1 not EOF


# 1.12 27-Sep-1996 thorpej

RCS id police.


# 1.11 27-Sep-1996 thorpej

Correct behavior of setting number of saves to 0.
From Kenneth Stailey <kstailey@dol-esa.gov>, PR #2724.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.10 07-Jan-1996 pk

Fix formatting of timestamp (Mike Grupenhoff; PR#1906).


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.9 21-Jan-1995 jtc

Pass progname to the printf call in usage().


# 1.8 06-Jan-1995 jtc

Changed so that log entry format used when logfiles are rolled over
matches that of syslogd(8). This is a slightly modified version of
the patch Thorsten Lockert supplied with PR #684.

Changed manpage to reflect the fact that we are using gzip instead
compress.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.7 20-Feb-1994 pk

Check for reasonable syslog pid before HUPing.
Replace arbitrary constant by MAXPATHLEN.


# 1.6 07-Feb-1994 cgd

compatibility fixes suggested by Luke Mewburn <lm@rmit.edu.au>


# 1.5 10-Aug-1993 mycroft

Fix rcsid conflict.


# 1.4 01-Aug-1993 mycroft

Add RCS identifiers.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.3 22-May-1993 cgd

add use of "COMPRESS_POSTFIX" define, to determine what postfix
(e.g. ".Z", ".z", etc.) to append to compressed log files.


# 1.2 21-May-1993 cgd

use the correct (or so john brezak says) copyright.


# 1.1 21-May-1993 cgd

initial import of this log-rotation program to NetBSD