All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] logrotate scripts policy
@ 2010-05-11 15:04 Roman I Khimov
  2010-05-11 15:10 ` Roman I Khimov
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Roman I Khimov @ 2010-05-11 15:04 UTC (permalink / raw)
  To: openembedded-devel

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?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC] logrotate scripts policy
  2010-05-11 15:04 [RFC] logrotate scripts policy Roman I Khimov
@ 2010-05-11 15:10 ` Roman I Khimov
  2010-05-11 16:07   ` Roman I Khimov
  2010-05-11 15:15 ` Martin Jansa
  2010-05-11 23:05 ` Mike Westerhof
  2 siblings, 1 reply; 7+ messages in thread
From: Roman I Khimov @ 2010-05-11 15:10 UTC (permalink / raw)
  To: openembedded-devel

В сообщении от Вторник 11 мая 2010 19:04:05 автор Roman I Khimov написал:
> 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).

P.S. There are probably more that have /etc/logrotate.d installed and packaged 
in ${PN} without specifically mentioning it anywhere.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC] logrotate scripts policy
  2010-05-11 15:04 [RFC] logrotate scripts policy Roman I Khimov
  2010-05-11 15:10 ` Roman I Khimov
@ 2010-05-11 15:15 ` Martin Jansa
  2010-05-11 16:01   ` Roman I Khimov
  2010-05-11 23:05 ` Mike Westerhof
  2 siblings, 1 reply; 7+ messages in thread
From: Martin Jansa @ 2010-05-11 15:15 UTC (permalink / raw)
  To: openembedded-devel

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@gmail.com
Jansa Martin                 sip:jamasip@voip.wengo.fr 
JaMa                         



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC] logrotate scripts policy
  2010-05-11 15:15 ` Martin Jansa
@ 2010-05-11 16:01   ` Roman I Khimov
  0 siblings, 0 replies; 7+ messages in thread
From: Roman I Khimov @ 2010-05-11 16:01 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: Text/Plain, Size: 703 bytes --]

В сообщении от Вторник 11 мая 2010 19:15:49 автор Martin Jansa написал:
> 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 :).

I think this cases should be handled at distro level, for most of packages 
logrotate scripts will be added as separate source files for the package and 
luckily that are very easy to override for distros (or even machines if there 
is a need to) in OE implementing any policy needed.

-- 
 http://roman.khimov.ru
mailto: roman@khimov.ru
gpg --keyserver hkp://subkeys.pgp.net --recv-keys 0xE5E055C3

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC] logrotate scripts policy
  2010-05-11 15:10 ` Roman I Khimov
@ 2010-05-11 16:07   ` Roman I Khimov
  0 siblings, 0 replies; 7+ messages in thread
From: Roman I Khimov @ 2010-05-11 16:07 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: Text/Plain, Size: 1042 bytes --]

В сообщении от Вторник 11 мая 2010 19:10:21 автор Roman I Khimov написал:
> В сообщении от Вторник 11 мая 2010 19:04:05 автор Roman I Khimov написал:
> > 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).
> 
> P.S. There are probably more that have /etc/logrotate.d installed and
>  packaged in ${PN} without specifically mentioning it anywhere.

P.P.S. And because of that (and to simplify things in general) if might be 
easier to handle logrotate script packaging with respectful  
rsuggests/rrecommends/whatever in bitbake.conf. By default.

-- 
 http://roman.khimov.ru
mailto: roman@khimov.ru
gpg --keyserver hkp://subkeys.pgp.net --recv-keys 0xE5E055C3

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC] logrotate scripts policy
  2010-05-11 15:04 [RFC] logrotate scripts policy Roman I Khimov
  2010-05-11 15:10 ` Roman I Khimov
  2010-05-11 15:15 ` Martin Jansa
@ 2010-05-11 23:05 ` Mike Westerhof
  2010-05-12 10:19   ` Roman I Khimov
  2 siblings, 1 reply; 7+ messages in thread
From: Mike Westerhof @ 2010-05-11 23:05 UTC (permalink / raw)
  To: openembedded-devel

Roman I Khimov wrote:
...
> 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.

The NSLU2 has a grand total of 8MB of flash space for bootloader,
kernel, and the filesystem.  We don't have even a few KB left right now
for those extra packages.  Keep in mind that even a 20-byte script will
have a large footprint in the opkg database that's on the filesystem, so
that space is in addition.

It's really really difficult to build an image without a whole lot of
extraneous stuff in it, and I suspect that extraneous stuff is all in
there for the same reasoning, which goes along the lines of "It's only a
little bit of space..." -- but it all adds up, and when your total
rootfs can only be 5.5 MB or so...

I'm not going to NAK this, but I will ask that if you do this please
spend some time with the SlugOS image recipes to remove all the packages
that this adds by default, with whatever mechanism you meant when you
say "but you can get rid of those packages if you really don't want them".

-Mike (mwester)



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC] logrotate scripts policy
  2010-05-11 23:05 ` Mike Westerhof
@ 2010-05-12 10:19   ` Roman I Khimov
  0 siblings, 0 replies; 7+ messages in thread
From: Roman I Khimov @ 2010-05-12 10:19 UTC (permalink / raw)
  To: openembedded-devel

В сообщении от Среда 12 мая 2010 03:05:15 автор Mike Westerhof написал:
> Roman I Khimov wrote:
> > 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.
> 
> The NSLU2 has a grand total of 8MB of flash space for bootloader,
> kernel, and the filesystem.  We don't have even a few KB left right now
> for those extra packages.  Keep in mind that even a 20-byte script will
> have a large footprint in the opkg database that's on the filesystem, so
> that space is in addition.
> 
> It's really really difficult to build an image without a whole lot of
> extraneous stuff in it, and I suspect that extraneous stuff is all in
> there for the same reasoning, which goes along the lines of "It's only a
> little bit of space..." -- but it all adds up, and when your total
> rootfs can only be 5.5 MB or so...

OK, that's exactly the kind of feedback I've wanted to get. But as such 
constraints are not common (or they are?), I still think that this should be 
(and easier to) implemented in opt-out fashion. So, I'll try to cook up a 
patch today that does 

RRECOMMENDS_${PN} += "${PN}-logrotate"
RSUGGESTS_${PN}-logrotate += "logrotate"

and then add some "PURGE_LOGROTATE" variable that will trigger *-logrotate 
packages removal from image if there is a need to.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-05-12 10:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-11 15:04 [RFC] logrotate scripts policy Roman I Khimov
2010-05-11 15:10 ` Roman I Khimov
2010-05-11 16:07   ` Roman I Khimov
2010-05-11 15:15 ` Martin Jansa
2010-05-11 16:01   ` Roman I Khimov
2010-05-11 23:05 ` Mike Westerhof
2010-05-12 10:19   ` Roman I Khimov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.