Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 7144 - logrotate issues
Summary: logrotate issues
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Mr. Bones. (RETIRED)
URL:
Whiteboard:
Keywords:
: 20907 (view as bug list)
Depends on: 16308
Blocks: 10933
  Show dependency tree
 
Reported: 2002-08-27 20:44 UTC by Mr. Bones. (RETIRED)
Modified: 2003-06-09 16:06 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
A logrotate ebuild. (logrotate-3.6.5-r1.tar.gz,1.03 KB, application/x-gzip)
2003-03-05 14:23 UTC, Wayne Davison
Details
Fix a couple minor things in the 3.6.5-r1 ebuild (logrotate.patch,946 bytes, patch)
2003-05-14 21:54 UTC, Wayne Davison
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mr. Bones. (RETIRED) gentoo-dev 2002-08-27 20:44:16 UTC
Several things:

First, there is no mention of logrotate, or equivalent functionality in
the install instructions.  This seems like a pretty large oversight since
without a log rotation scheme, the disk is going to fill up eventually
any it will be "our" fault since we never told the "user" that they needed
to do something about it.

Second, once the user figures out that they need log rotation, they may try
to "emerge logrotate" and find that it doesn't actually *do* anything out
of the box (so to speak).  I think the cron file and logrotate.conf files
should be installed into /etc/cron.daily and /etc respectively.  At least
then, the user has something to start from.  Better yet, this is Gentoo
Linux after all, we're supposed to be the hot stuff here.  Why not include
a functional logrotate.conf that's closer to what people might want?

Third, the default logrotate.conf uses the include functionality of
logrotate to grab files from /etc/logrotate.d.  The ebuild script doesn't
create this directory.
Comment 1 Seemant Kulleen (RETIRED) gentoo-dev 2002-08-28 01:57:35 UTC
Az, thoughts on this?
Comment 2 Martin Holzer (RETIRED) gentoo-dev 2002-08-28 04:36:26 UTC
how about a nice explain how to do text after emerging ?

 einfo in the ebuild
Comment 3 Nicholas Wourms 2002-08-28 12:52:56 UTC
For the second point, I agree in that there should be a base logrotate.conf
based on the default daemons, etc which are installed.

On the third point, getting logrotate up and running is a major PITA w/o any
predefined scripts.  I would be nice, but admittedly a ton of work, to populate
each of the currently available daemon with its own script for logrotate.d.

Perhaps a USE flag, logrotate, could be used to determine if the "extras" get
installed?
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2002-08-28 13:58:57 UTC
Guess I never thought about it, as I use sysklogd with vcron, which
rotates logs nicely all by itself.

Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2003-02-09 05:00:11 UTC
Nicholas, you are the lucky canditate that can add the scripts, as it seems
you sorda know something about them :P
Comment 6 Nicholas Wourms 2003-02-10 08:54:10 UTC
Already one step ahead of you, I've modified (locally) the logrotate ebuild to install properly along with a default conf and cron script.  I've also been "stealing" logrotate.d scripts from RedHat's rpm's.  I will add them to ebuilds, but I need to know first if we should have a USEFLAG to determine their installation?  Or should I just check for the existance of /etc/logrotate.d?  Please advise.
Comment 7 Martin Schlemmer (RETIRED) gentoo-dev 2003-02-16 17:48:32 UTC
I think just install them.  They usually are small, and the user who
use logrotate will delete/enable those he need.  Rather that, than
confusion about them not being there.
Comment 8 Mr. Bones. (RETIRED) gentoo-dev 2003-02-24 15:15:36 UTC
Here's the /etc/logrotate.d/syslog-ng I'm using here:

/var/log/messages /var/log/mail.log /var/log/mail.err /var/log/kern.log /var/log/auth.log /var/log/cron.log {
    sharedscripts
    postrotate
	/etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
    endscript
}
Comment 9 Aron Griffis (RETIRED) gentoo-dev 2003-03-04 15:40:19 UTC
Dragon, how's it going on this?
Comment 10 Nicholas Wourms 2003-03-05 08:29:22 UTC
I'm working on it when I can (as you are aware I do have a fairly full plate), but there are a bunch of packages which need the logrartate config fragments.  I would prefer to check the majority of these fragments in at once so that there is some uniformity.  I also want to make sure I get as much coverage as I can on this first round.  Also, I would like Martin to add /etc/logrotate.d to baselayout since he wants the fragments installed regardless of whether the person uses logrotate or not.  Once the baselayout with this dir is stable, I will then commit the updated ebuilds and logrotate config fragments.  However, if this is an issue, let me know and I'll devote more resources to completing it.
Comment 11 Aron Griffis (RETIRED) gentoo-dev 2003-03-05 08:52:49 UTC
To be honest, I would suggest a WIB (worse-is-better) approach.  I think that if
we have some known culprits, we should get a first pass out there and not worry
about the stragglers.  We'll bring them into the fold as we can, but it might be
too much to attempt to get a wide range of packages on the first pass.

Regarding /etc/logrotate.d, there is no need whatsoever to wait for the 
baselayout change.  The first package to add a snippet will automatically create
that directory (as you know) and a subsequent baselayout update won't hurt
anything.  It's not a bad idea to get logrotate.d into baselayout, but I don't
think that should hold us up.

If there's anything I can do to help out, let me know.  If you have some starter
snippets, maybe you should add them as attachments here so you're not the only
one with the info...  ;-)
Comment 12 Martin Schlemmer (RETIRED) gentoo-dev 2003-03-05 14:12:26 UTC
Right, I do not see what baselayout have to do with this ... it should actually
be created initially by logrotate (maybe with keepdir ...).
Comment 13 Wayne Davison 2003-03-05 14:23:23 UTC
Created attachment 8992 [details]
A logrotate ebuild.

I improved the logrotate ebuild before I found this bug, so I'll go ahead and
include it here, just in case it has something that you'll find useful.  It has

the following changes:

+ Silences the CVS/Root spewage in the 3.6.5 "make" output.
+ Don't twiddle the Makefile, just set RPM_OPT_FLAGS with our CFLAGS
  (note that the tweaking of the Makefile was in the wrong section
  anyway -- it would have gotten repeated on repeated compilations if
  someone was using ebuild manually).
+ Installs a tweaked logrotate.conf file (doesn't refer to RPMs).
+ Installs a logrotate.d dir.
+ Installs a crontab file in the cron.daily dir.
+ The package now depends on virtual/cron.

Take a look if you haven't already tweak all these items.
Comment 14 Wayne Davison 2003-03-05 14:28:25 UTC
On the topic of putting logrotate.d into the baselayout, I agree with Martin
(it just needs to be in the logrotate package).  The .keep file is needed to
prevent the directory from vanishing (which would cause logrotate to exit
with an error).  Having an empty .keep file in the dir does not adversely
affect logrotate (it reads the file, but does not do anything nor does it
complain about it being empty).
Comment 15 Nicholas Wourms 2003-03-07 19:55:19 UTC
Martin, since logrotate isn't a required package, then what happens to the people who don't have logrotate emerged but emerge a package with a logrotate fragment?  You told me that I should just have each fragment install by default, without any use flags or conditionals.  There's no reason why putting it into baselayout would be bad.  It's either that or a USE flag, as we need some way to make sure we don't get a sandbox error.

Wayne, actually I've already done those things, but thanks nontheless for your contribution.  The reason I need logrotate.d in baselayout is because of how we decided to impliment the installation of logrotate fragments [in this case, without conditionals].  Besides, it just makes things easier for me.

Since Logrotate is developed by redhat, I'll be making my own tarballs based on cvs tags rather then by rpm or debian's sources.  Anyhow, we'll get this fixed up.
Comment 16 Aron Griffis (RETIRED) gentoo-dev 2003-03-07 22:07:30 UTC
Dragon, won't the directory /etc/logrotate.d be created automatically
by any package installing a logrotate fragment?  Possibly I'm
misunderstanding something, but I don't think there is any need for
the directory to exist prior to installing fragments...
Comment 17 Nicholas Wourms 2003-03-08 07:58:40 UTC
Ok, I had a real brainfart when writing that last night.  Aaron, you are totally correct, of course portage will make the dir!  What was I thinking?  Ok, well that solves that one, I'll just have logrotate's ebuild install the .keep file.  Thanks for setting me straight :-).
Comment 18 Aron Griffis (RETIRED) gentoo-dev 2003-03-10 23:06:07 UTC
Just FYI, I have added a logrotate.d snippet to the
syslog-ng-1.6.0_rc1-r1 ebuild based on Michael's suggestion.
Comment 19 Aron Griffis (RETIRED) gentoo-dev 2003-04-22 21:52:47 UTC
Re-assign to the original bug filer since he's now a dev and can decide what needs to be done next, if anything, to finish this out.
Comment 20 Paul Slinski 2003-04-29 09:40:41 UTC
I was just fighting with logrotate here and had some problems. I wont speak of them here, but, I think a solution to your question of where to place the logrotate.d/* files would be to place them in /usr/share/logrotate-*/samples directory. Using this method would prevent confs from being installed for programs that do not exist on the user's system (and keep the cron log from filling up with errors). Placing a note at the end of the ebuild explaining the location of the confs would be beneficial as well.

Thought I'd throw in my 2 cents and see if I could get some change anyhow :)
-P
Comment 21 Mr. Bones. (RETIRED) gentoo-dev 2003-05-13 22:53:21 UTC
*** Bug 20907 has been marked as a duplicate of this bug. ***
Comment 22 Wayne Davison 2003-05-14 21:54:45 UTC
Created attachment 11998 [details, diff]
Fix a couple minor things in the 3.6.5-r1 ebuild

A couple things I noticed in the new logrotate 3.6.5-r1 ebuild:

- The src_compile() function is patching the source.  This should be done
  in the src_unpack() function so that someone using ebuild manually can
  run "ebuild ... compile" multiple times.

- The digest is missing the line for the selinux patch.

I've attached a patch that fixes these problems.
Comment 23 Mr. Bones. (RETIRED) gentoo-dev 2003-05-15 18:31:19 UTC
Wanye -  Thanks for the patch.  I've applied it so please try out the
latest logrotate ebuild.

Thanks for testing.
Comment 24 Mr. Bones. (RETIRED) gentoo-dev 2003-06-09 16:06:34 UTC
Masked testing for long enough so unmasked and closing this bug.