Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jan 1998 23:39:42 -0800 (PST)
From:      Tom <tom@sdf.com>
To:        "Daniel O'Callaghan" <danny@panda.hilink.com.au>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: 2nd call for comments: New option for newsyslog
Message-ID:  <Pine.BSF.3.95q.980116232602.7843A-100000@misery.sdf.com>
In-Reply-To: <Pine.BSF.3.91.980117160511.29251O-100000@panda.hilink.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help

On Sat, 17 Jan 1998, Daniel O'Callaghan wrote:

> On Fri, 16 Jan 1998, Tom wrote:
> 
> > On Sat, 17 Jan 1998, Daniel O'Callaghan wrote:
> > 
> > > I'm added a '-m' option to newsyslog which will allow it to process log 
> > ...
> > > Does anyone have any comments, positive or negative, about this extension 
> > > to newsyslog?  I'd like to get this reviewed and into 2.2.6.
> > 
> >   I submitted on the PRs on this issue...
> > 
> >   "-m" seems a bit specific.  What about weekly and daily options too?  If
> > you do, newsyslog starts looking a lot like cron.  Using newsyslog to
> > rotate non-syslog created log files is rather a stretch.  Using newsyslog
> > for non-text "logs" is even more of stretch.
> 
> >   Perhaps wtmp rotation should just be done by cron right in the monthly
> > script, where the accounting processing happens?
> 
> Valid points, but I don't see any reason not to use newsyslog for 
> rotating a logfile.  newsyslog has the nice feature of rotating on size, 
> which is irrelevant to the current problem, but it also gzips and rotates 
> the gzipped files, which is nice.  Why create a bunch of Bourne shell 
> commands, when an entry in newsyslog.conf will suffice?

  Well first all no _new_ Bourne shell scripts would be required, as we
already have the accounting script in /etc/periodic/monthly.  For other,
non-accounting stuff, you are still going to require special processing
that newsyslog will _not_ do (like a log analyzer).

  gzip is useless for user accounting, as you can't process the previous
months info if it is gzipped.  You need to rotate the file, process it,
then gzip it.  This is probably better handled by adding rotation to 
existing script.

> As for the daily and weekly options, there are always 24 hours in a day
> and 168 hours in a week, so fixed period rotations are correctly handled. 
> Or are they?  In fact, rotating every 24 or 168 hours may not be what was
> wanted, if the sysadmin really wants the files rotated as close as
> possible to midnight with the week starting on Sunday. 

  In some cases, accurate midnight rotation is critical.  

> So maybe what is needed is a flag to newsyslog which tells it to process 
> daily, weekly and monthly entries, and newsyslog itself can decide 
> whether today is the first day of the week or month.

  In which case we can call it cron2

  newsyslog works well when you need to rotate syslog logs, but if you
need to do some pre or post processing too (like the login accounting
problem), you might as well use cron.  You are going to have to create
lots of shell scripts for all of these pre and post processing jobs
anyhow, so you might as well let cron process it.

  I feel uncomfortable for using newsyslog for processing anything other
than syslog generated logs, especially considering how newsyslog HUPs
syslog whenever it moves a log file.

> Danny

Tom




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.980116232602.7843A-100000>