From owner-freebsd-questions@FreeBSD.ORG Wed May 5 18:51:32 2010 Return-Path: Delivered-To: freebsd-questions@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C3C5106566B for ; Wed, 5 May 2010 18:51:32 +0000 (UTC) (envelope-from glarkin@FreeBSD.org) Received: from mail1.sourcehosting.net (113901-app1.sourcehosting.net [72.32.213.11]) by mx1.freebsd.org (Postfix) with ESMTP id 27CAC8FC18 for ; Wed, 5 May 2010 18:51:31 +0000 (UTC) Received: from 68-189-245-235.dhcp.oxfr.ma.charter.com ([68.189.245.235] helo=cube.entropy.prv) by mail1.sourcehosting.net with esmtp (Exim 4.69 (FreeBSD)) (envelope-from ) id 1O9jgt-000O0P-C0; Wed, 05 May 2010 14:51:31 -0400 Received: from [127.0.0.1] (fireball.entropy.prv [192.168.1.12]) by cube.entropy.prv (Postfix) with ESMTP id E10673F6D769; Wed, 5 May 2010 14:51:26 -0400 (EDT) Message-ID: <4BE1BE30.9040004@FreeBSD.org> Date: Wed, 05 May 2010 14:51:28 -0400 From: Greg Larkin Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Paul Hoffman References: <4BE18B3E.9080006@FreeBSD.org> <87zl0efkie.fsf@kobe.laptop> In-Reply-To: X-Enigmail-Version: 0.96.0 OpenPGP: id=1C940290 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.4 (/) Cc: Giorgos Keramidas , freebsd-questions@FreeBSD.org Subject: Re: newsyslog not reading /ect/rc.conf arguments? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: glarkin@FreeBSD.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 May 2010 18:51:32 -0000 -----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-----