Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 05 May 2010 14:51:28 -0400
From:      Greg Larkin <glarkin@FreeBSD.org>
To:        Paul Hoffman <phoffman@proper.com>
Cc:        Giorgos Keramidas <keramida@ceid.upatras.gr>, freebsd-questions@FreeBSD.org
Subject:   Re: newsyslog not reading /ect/rc.conf arguments?
Message-ID:  <4BE1BE30.9040004@FreeBSD.org>
In-Reply-To: <p06240863c8075364d09b@[10.20.30.158]>
References:  <p0624085bc80737ee60c3@[10.20.30.158]>	<4BE18B3E.9080006@FreeBSD.org> <p0624085bc80737ee60c3@[10.20.30.158]>	<87zl0efkie.fsf@kobe.laptop> <p06240863c8075364d09b@[10.20.30.158]>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul Hoffman wrote:
> At 6:14 PM +0300 5/5/10, Giorgos Keramidas wrote:
>> How did you start newsyslog?  There's an rc.d script that should *read*
>> the flags from rc.conf:
>>
>>    /etc/rc.d/newsyslog start
> 
> Yes, exactly. I did '/etc/rc.d/newsyslog stop', then '/etc/rc.d/newsyslog start'.
> 
> 
> At 11:14 AM -0400 5/5/10, Greg Larkin wrote:
>> newsyslog is invoked at boot time by the /etc/rc.d/newsyslog script to
>> create missing log files, but after that, it's invoked regularly by cron
>> to do the actual rotations.  Check the /etc/crontab file and add your
>> flags there, and you should be all set.
> 
> Thanks, I see that now.
> 
> This seems like a broken model: intial boot and later restarts uses arguments from /etc/rc.conf, 
> but the periodic call does not. I don't think we want people modifying /etc/crontab, do we? 
> Shouldn't /etc/crontab be calling '/etc/rc.d/newsyslog restart' instead?
> 
> --Paul Hoffman

Hi Paul,

The problem here is that the /etc/rc.d/newsyslog script is used to
initialize the system at boot time with missing log files specified by
/etc/newsyslog.conf and not do any log rotation.  The arguments passed
to that invocation of newsyslog are (by default):

- -C      If specified once, then newsyslog will create any log files
        which do not exist, and which have the C flag specified in their
        config file entry.  If specified multiple times, then newsyslog
        will create all log files which do not already exist.  If log
        files are given on the command-line, then the -C or -CC will
        only apply to those specific log files.
- -N      Do not perform any rotations.  This option is intended to be
        used with the -C or -CC options when creating log files is the
        only objective.

Because -N is not used under normal circumstances, but should be used at
boot time, you would need two different specifications for newsyslog
flags in /etc/rc.conf, one for boot time and one for invocation from cron.

That would complicate the rc system somewhat, so I would lean toward
simply adding your preferred arguments to the crontab file.  I modify
the system crontab file on my machines, and I don't think there's a big
problem doing that.

Regards,
Greg
- --
Greg Larkin

http://www.FreeBSD.org/           - The Power To Serve
http://www.sourcehosting.net/     - Ready. Set. Code.
http://twitter.com/sourcehosting/ - Follow me, follow you
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFL4b4w0sRouByUApARArxgAJ4gvUbJK69ApZ9tr1LNE1fWd20fjgCfc4db
qyR2z9wgv53vIAYGQ+2u0HU=
=8qby
-----END PGP SIGNATURE-----




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BE1BE30.9040004>