Re: newsyslog(8) patch for both size and time checks



Garance A Drosehn wrote:
At 1:59 PM +0400 5/12/09, Dmitry Morozovsky wrote:

for now, if log is configured to be rotated in time manner, its size is not checked ...

The following simple patch should fix the problem. Any objection to commit this?

It would fix your problem, but it changes the behavior as is explicitly
documented in 'man newsyslog.conf' . There is a paragraph in the man
page which makes it clear that if both fields are specified, then the
log file will only be rotated if both conditions are true.

I've never liked that paragraph and find the
documented behavior is much less useful than the
proposed behavior.

With the documented behavior, the effect is "rotate
at this size, but no more often than XXX time interval",
which serves to limit the number of log files created,
but not the total size. In practice, /var/log total
size is almost always the critical resource.

If compatibility is essential, perhaps we could
add a new flag to control this behavior. (I would
argue for changing the default and providing a flag
to obtain the old behavior.)

Tim

_______________________________________________
freebsd-current@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Rotating logs (and keeping the logs tail)
    ... I use a wiki engine that produces an event log, which I want to rotate. ... Can't you just write a script that updates the tag to a separate file, ... # rotate-and-keep.sh - Rotate a log file, ... # GNU General Public License for more details. ...
    (Debian-User)
  • Re: Recovery by Charge Coupled Device
    ... some flag in the JPEG to say "rotate this image upon display". ... has a sensor to set the orientation in the EXIF data. ... Canon even have a menu option in the device to "rotate the image" ... (I must admit that although the camera has other limitations, ...
    (alt.sysadmin.recovery)
  • Re: Minor HEADSUP - "New order" for newsyslog
    ... waits 10 seconds (after all signals are sent) ... are done in a safer order, and any single daemon is sent only ... one signal (instead of one signal for each log file that needed ... to rotate a large number of apache log files, ...
    (freebsd-current)
  • Re: How to remove a single line from a flat file (Still very off-topic.)
    ... Every program that writes a log file under UNIX needs a way to split the old from the current. ... Contrast with a file system that actually stores records you can delete. ... Simply open the log file, copy the records you want to "rotate", and delete them off the front of the log file as you go. ... And that lock should be in the file system, rather than as a user-level work-around for a lack of functionality. ...
    (comp.lang.tcl)
  • Re: [PATCH] newsyslog - dont compress first log file
    ... Just remove the Z flag from the applicable lines in /etc/newsyslog.conf, and you'll accomplish not compressing the log files entirely without patching newsyslog. ... If you want no special treatment of a particular log file then change the flags for that log file in to -. ... Version: GnuPG v1.4.6 (FreeBSD) ...
    (freebsd-hackers)

Loading