Gentoo Archives: gentoo-user

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