[oe] [RFC] logrotate scripts policy

Martin Jansa martin.jansa at gmail.com
Tue May 11 15:15:49 UTC 2010


On Tue, May 11, 2010 at 07:04:05PM +0400, Roman I Khimov wrote:
> Hello all.
> 
> Seems like most OE users are fine with /var/log being on tmpfs and thus not 
> care about logs and their rotation. We actually care about logs and thus need 
> to rotate them. I have several patches adding logrotate scripts to recipes but 
> I'd like to discuss the way they should be packaged in order to satisfy both 
> camps (caring about logs and don't) and hopefully develop some policy for 
> that.
> 
> As of now, my patches package logrotate scripts like this:
> 
> +PACKAGES =+ "${PN}-logrotate"
> +FILES_${PN}-logrotate = "${sysconfdir}/logrotate.d/squid"
> +RRECOMMENDS_${PN} += "${PN}-logrotate"
> +RDEPENDS_${PN}-logrotate += "logrotate"
> 
> It works fine here, but I guess that people not caring about logs don't want 
> to have logrotate installed and probably don't want /etc/logrotate.d cruft 
> either. So, an opposite approach could be:
> 
> +RSUGGESTS_${PN} += "${PN}-logrotate"
> +RSUGGESTS_${PN}-logrotate += "logrotate"
> 
> But then if you need logrotate scripts, you have to add all those *-logrotate 
> packages to the respective image along with logrotate program itself. As the 
> number of *-logrotate packages can be quite big it might be easier to add some 
> IMAGE_LINGUAS-alike hook to image class with "IMAGE_LOGROTATE=y" parameter 
> activating it.
> 
> So, probably a better approach and what I'm proposing is:
> 
> +RRECOMMENDS_${PN} += "${PN}-logrotate"
> +RSUGGESTS_${PN}-logrotate += "logrotate"
> 
> This way all *-logrotate packages will get installed by default, but not the 
> logrotate program. So, it will eat some little space in /etc/logrotate.d for 
> everyone by default (but you can get rid of those packages if you really don't 
> want them), but would allow to switch rotation on/off easily with just one 
> package included or not in the image.
> 
> Also, in org.oe.dev there is already callweaver, asterisk and cluster-
> resource-agents that have logrotate scripts installed in /etc/logrotate.d 
> (that legitimizes RRECOMMENDS for *-logrotate a bit) and callweaver 
> RRECOMMENDS logrotate (asterisk has that commented out, so it supports 
> RSUGGESTS approach to logrotate itself a bit).
> 
> Suggestions, recommendations, comments?

Both proposed aproaches seem good to me. We have /var/log on tmpfs but I
would still add logrotate to image because realy big log in tmpfs is
much worse than few more kB in image (nobody wants a unusable phone 
after 3 days just because of ram full of logs).

But maybe there are different "optimal" logrotate rules for people with
tmpfs and without, which is IMHO harder to implement. I don't care about
logs enough to ask for this :).

Regards,

-- 
uin:136542059                jid:Martin.Jansa at gmail.com
Jansa Martin                 sip:jamasip at voip.wengo.fr 
JaMa                         




More information about the Openembedded-devel mailing list