Commit Graph

41 Commits

Author SHA1 Message Date
ad 11527af796 Sleep for 10 seconds before compressing the old log. 2001-05-06 21:03:25 +00:00
ad 0feab73383 Get the correct signal type. Pointed out by Hauke Fath <hf@tangro.de> in
bin/12453, real fix by me.
2001-03-22 17:54:54 +00:00
ad f93ec22c6d If configured to rotate at a specfic time and no historical log exists, then
don't consider the age of the historical log.
2001-03-18 16:34:08 +00:00
ad 80064cab88 New option, `-s': don't bother with PID files or signals. 2000-09-21 10:27:34 +00:00
tron 0012d64356 Fixed reversed result test in call to chown(2) which caused bogus
error message.
2000-08-22 16:23:15 +00:00
tron 815deae8b6 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"
2000-08-22 14:20:17 +00:00
ad 1784978a24 - Wrap line.
- Minor oops in a comment.
2000-07-24 15:15:25 +00:00
ad 6afadc9fb4 Simple const. 2000-07-19 10:52:35 +00:00
enami 069d55ea4c - Free storage allocated by fparseln.
- Handle comment only or empty line in the parser.
2000-07-19 07:22:53 +00:00
ad 677a105692 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.
2000-07-18 15:59:24 +00:00
ad 5bf219a1a3 - Use _PATH_VARRUN.
- Address PR 10577 from mjl: recognise '.' as user/group seperator.
2000-07-13 11:28:50 +00:00
ad 543370583e parse(): be sure to clear *log before filling. 2000-07-11 12:06:32 +00:00
ad ef0846927c - 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.
2000-07-11 11:39:46 +00:00
ad e854f5df38 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.
2000-07-10 11:15:07 +00:00
assar e2ba218ce3 print size_t as casted to (u_long) with %lu 2000-07-10 02:23:04 +00:00
aymeric 51ccad7517 newsyslog wouldn't parse the count field because sscanf return value was
tested against the wrong value (0 != 1)
2000-07-09 12:14:01 +00:00
ad c9545d3e5d Back out previous two. 2000-07-07 15:42:35 +00:00
ad 136e84eb05 Redo previous slightly; add `-m' option to allow multiple instances. 2000-07-07 14:09:41 +00:00
ad 2f3d5bfcd0 Don't allow more than one instance when running as root. 2000-07-07 13:53:14 +00:00
ad e55de4b4cf 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.
2000-07-07 10:52:41 +00:00
ad 604db10508 - 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.
1999-11-30 12:03:24 +00:00
ad 37a134f54b 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.
1999-10-06 13:26:28 +00:00
ad b545302160 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.
1999-10-05 12:11:27 +00:00
soren 30d18a154c Remove extraneous colons and newlines from perror(3) arguments. 1999-09-30 12:35:52 +00:00
christos 1b399e6819 char -> unsigned char and portable printf formats. 1998-12-19 20:10:08 +00:00
simonb b5c503ca40 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.
1998-07-29 01:31:50 +00:00
mrg 2beab49a06 - 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
1998-07-06 06:45:41 +00:00
kleink fb7c0a91b5 Need <time.h> for time() and ctime() prototypes. 1998-04-02 10:35:26 +00:00
lukem 6c49a51bc6 WARNSify, fix .Nm usage, getopt returns -1 not EOF 1997-10-19 06:23:50 +00:00
thorpej 1d4301453f RCS id police. 1996-09-27 01:56:55 +00:00
thorpej e8e306239b Correct behavior of setting number of saves to 0.
From Kenneth Stailey <kstailey@dol-esa.gov>, PR #2724.
1996-09-27 01:55:26 +00:00
pk 94f289c7bb Fix formatting of timestamp (Mike Grupenhoff; PR#1906). 1996-01-07 00:48:24 +00:00
jtc bea110759f Pass progname to the printf call in usage(). 1995-01-21 21:53:46 +00:00
jtc c15bd8dda9 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.
1995-01-06 19:20:20 +00:00
pk 1a674dfd60 Check for reasonable syslog pid before HUPing.
Replace arbitrary constant by MAXPATHLEN.
1994-02-20 09:54:45 +00:00
cgd ecb9421ced compatibility fixes suggested by Luke Mewburn <lm@rmit.edu.au> 1994-02-07 07:00:26 +00:00
mycroft 7a5112319b Fix rcsid conflict. 1993-08-10 00:05:51 +00:00
mycroft e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
cgd c210f82522 add use of "COMPRESS_POSTFIX" define, to determine what postfix
(e.g. ".Z", ".z", etc.) to append to compressed log files.
1993-05-22 03:52:17 +00:00
cgd 6da19b6501 use the correct (or so john brezak says) copyright. 1993-05-21 14:47:29 +00:00
cgd 90beb7e48c initial import of this log-rotation program to NetBSD 1993-05-21 14:43:59 +00:00