Commit Graph

31 Commits

Author SHA1 Message Date
Brian Somers
7bc6d0158f Fix the type of the NULL arg to execl()
Idea from: Theo de Raadt <deraadt@openbsd.org>
2001-07-09 09:24:06 +00:00
Chris D. Faulhaber
3c0cec43e7 - Correct MAXPATHLEN/MAXHOSTNAMELEN usage
- Check return values of malloc() and strdup()
- Replace strcpy()/strcat()/sprintf() usage with strlcpy()/snprintf

Reviewed by:	-audit
2001-01-20 17:36:08 +00:00
Josef Karthauser
6b9a6e1f20 When warning that a log file can't be compressed, tell the reader which
log file it was.
2000-08-15 09:34:41 +00:00
Dag-Erling Smørgrav
78ae26252e Allow user to specify which logs to rotate 2000-05-11 10:17:54 +00:00
Hellmuth Michaelis
70fa0440ad - 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
2000-04-04 08:50:01 +00:00
Hellmuth Michaelis
c7c83aedf5 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.
2000-04-04 08:38:30 +00:00
Peter Wemm
97d92980a9 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
David E. O'Brien
ae2c5cf197 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)
1999-07-28 04:26:10 +00:00
David E. O'Brien
63b5983b9e Syntax for user/group is changed from "user.group" to "user:group" to be
consistant with chown(8).
1999-06-28 03:15:02 +00:00
Garrett Wollman
8fba304b43 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.
1999-01-22 19:38:39 +00:00
Peter Wemm
ab65c1d9b0 The largest PID is now 99999
Reported by: Ben Stuyts <ben@stuyts.nl>
1998-12-23 12:03:33 +00:00
Andrey A. Chernov
dc55fe4c05 Add optional config file field: signal number to send (defaulted to HUP)
F.e. apache restarts less agressively  on USR1 then on HUP
1998-06-09 18:24:04 +00:00
Tim Vanderhoek
b2805b78b6 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.
1998-05-10 21:13:29 +00:00
Tim Vanderhoek
28a9b05b87 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.
1998-05-10 19:04:06 +00:00
Tim Vanderhoek
b813e9a54a Fix the usage here, too (-F option).
Typo fix in comment ("Force the tim now matter what" s/tim/trim/)
1998-05-10 18:47:50 +00:00
Paul Traina
07d95a3e31 Add "-F" (force) flag to newsyslog.
Submitted by:	Terry Lambert <terry@freebsd.org>
1998-03-14 22:28:25 +00:00
Andrey A. Chernov
19df0544a0 Sleep 10secs after kill -HUP instead of 3secs, some daemons like Apache
may have log time to re-configure
1997-11-30 18:58:18 +00:00
Philippe Charnier
b8981f4416 Cosmetic in err() strings. 1997-10-06 07:46:08 +00:00
Brian Somers
ea3b35174b 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.
1997-05-06 23:11:06 +00:00
Andrey A. Chernov
805bd6d982 Do not kill -HUP syslog if running in user mode (-r), it allows
private user logs rotation without error diagnostics
1997-05-05 15:00:15 +00:00
Andrey A. Chernov
3d807d3be6 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.
1997-05-04 01:53:53 +00:00
Warner Losh
6c3f552a31 compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-31 05:11:47 +00:00
Peter Wemm
476602a9d0 Revert $FreeBSD$ to $Id$ 1997-02-22 16:15:28 +00:00
Jordan K. Hubbard
1130b656e5 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.
1997-01-14 07:20:47 +00:00
Jordan K. Hubbard
2252262f79 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>
1996-09-09 15:32:26 +00:00
Jordan K. Hubbard
8e1d470afc 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>
1996-09-06 06:36:07 +00:00
Alexander Langer
c8d7d3dbe3 Added function prototypes and removed in-line prototypes of standard
functions such as malloc and time.
1996-06-08 23:32:10 +00:00
Alexander Langer
d442994ef5 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>
1996-06-07 16:27:28 +00:00
Thomas Graichen
9bf204a77e 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).
1996-01-16 10:32:04 +00:00
Thomas Graichen
c6bf200d31 Obtained from: NetBSD (PR#1906)
removed date formatting glitch in newsyslog
1996-01-09 08:40:08 +00:00
Thomas Graichen
abf212be33 Obtained from: NetBSD
imported the newsyslog command from NetBSD - it make the "rotation" of
the logfiles much simpler (it is currently done by "hand" in the
/etc/[daily,weekly,monthly] scripts) - now it will be done by invoking
newsyslog every hour which is very customizable via a
/etc/newsyslog.conf file
1996-01-05 09:28:11 +00:00