[oe] [RFC] logrotate scripts policy

Roman I Khimov khimov at altell.ru
Tue May 11 15:04:05 UTC 2010


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?




More information about the Openembedded-devel mailing list