Gentoo Archives: gentoo-user

From: Alex Corkwell <i.am.the.memory@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] portage summary logs not rotated any more
Date: Sun, 05 Apr 2015 16:49:59
Message-Id: 20150405164805.GA24890@luna
In Reply to: Re: [gentoo-user] portage summary logs not rotated any more by Alexander Kapshuk
1 On Sun, Apr 05, 2015 at 06:31:43PM +0300, Alexander Kapshuk wrote:
2 > On Sun, Apr 5, 2015 at 5:36 PM, Mick <michaelkintzios@×××××.com> wrote:
3 >
4 > On Sunday 05 Apr 2015 14:19:16 Alexander Kapshuk wrote:
5 > > On Sun, Apr 5, 2015 at 10:50 AM, Mick <michaelkintzios@×××××.com> wrote:
6 > > An observation I've made, is that my log rotation seems to have effected
7 > > all other logs in /var/log as well. It seems to have stopped working
8 > around
9 > > January this year.
10 > >
11 > > ls -lt /var/log/messages*
12 > > -rw------- 1 root root 9986127 Apr  5 16:10 /var/log/messages
13 > > -rw------- 1 root root  173843 Jan 12 10:20 /var/log/messages-20150112.gz
14 > > -rw------- 1 root root  277867 Jan  4 22:00 /var/log/messages-20150104.gz
15 > > -rw------- 1 root root  132157 Dec 28 20:30 /var/log/messages-20141228.gz
16 > > -rw------- 1 root root  142911 Dec 22 19:30 /var/log/messages-20141222.gz
17 >
18 > It seems to me that logrotate stopped rotating your logs back in Jan.  Did
19 > you
20 > change something in its configuration back then?
21 >
22 > This is what I have in /etc/cron.daily/logrotate:
23 > ================================================
24 > #!/bin/sh
25 >
26 > /usr/sbin/logrotate /etc/logrotate.conf
27 > EXITVALUE=$?
28 > if [ $EXITVALUE != 0 ]; then
29 >     /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]
30 > "
31 > fi
32 > exit 0
33 > =================================================
34 > I then went ahead and ran logrotate by hand, which resulted in the following
35 > output:
36 >
37 > /usr/sbin/logrotate /etc/logrotate.conf
38 > 501 Not authorised --- Reply not authenticated
39 > 501 Not authorised --- Reply not authenticated
40 > # echo $?
41 > 0
42 >
43 > I guess I have to figure out what the error message shown below is all about:
44 > 501 Not authorised --- Reply not authenticated
45 >
46 >
47
48 I don't know about the "501 Not authorised", but I remember having a
49 similar issue with logrotate not running beginning around the same time
50 (the last rotated log was the week of 20141221). I can't remember
51 exactly what I did, but I believe around then Gentoo (and my system)
52 switched from vixie-cron to cronie as default. If I remember correctly,
53 it was anacron that caused the problem.
54
55 Take a look at these lines from the default (at least, on my system) for
56 /etc/crontab:
57
58 # check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
59 # if anacron is not present
60 59 * * * * root [ ! -x /etc/cron.hourly/0anacron ] && rm -f
61 /var/spool/cron/lastrun/cron.hourly
62 9 3 * * * root [ ! -x /etc/cron.hourly/0anacron ] && rm -f
63 /var/spool/cron/lastrun/cron.daily
64 19 4 * * 6 root [ ! -x /etc/cron.hourly/0anacron ] && rm -f
65 /var/spool/cron/lastrun/cron.weekly
66 29 5 1 * * root [ ! -x /etc/cron.hourly/0anacron ] && rm -f
67 /var/spool/cron/lastrun/cron.monthly
68 */10 * * * * root [ ! -x /etc/cron.hourly/0anacron ] && { test -x
69 /usr/sbin/run-crons && /usr/sbin/run-crons ; }
70
71 Essentially, cron.{hourly,daily,weekly,monthly} only get run if
72 /etc/cron.hourly/0anacron is not executable. On my system, if I remember
73 correctly, /etc/cron.hourly/0anacron had the executable bit set after I
74 emerged cronie, but I never set up anacron. I don't know if it properly
75 runs all the cron.* scripts regularly by default, but after a quick
76 "chmod -x /etc/cron.hourly/0anacron" logrotate returned to running
77 regularly.
78
79 I really don't know what's going on with the 501, but I hope that helps
80 with getting it to run regularly (at least, unless you actually know how
81 to use anacron, in which you probably know whether or not this makes
82 some sense).

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] portage summary logs not rotated any more Alexander Kapshuk <alexander.kapshuk@×××××.com>