Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] portage summary logs not rotated any more
Date: Sun, 05 Apr 2015 14:36:51
Message-Id: 201504051536.36065.michaelkintzios@gmail.com
In Reply to: Re: [gentoo-user] portage summary logs not rotated any more by Alexander Kapshuk
1 On Sunday 05 Apr 2015 14:19:16 Alexander Kapshuk wrote:
2 > On Sun, Apr 5, 2015 at 10:50 AM, Mick <michaelkintzios@×××××.com> wrote:
3 > > On Sunday 05 Apr 2015 06:39:31 Alexander Kapshuk wrote:
4 > > > On Sun, Apr 5, 2015 at 1:18 AM, Mick <michaelkintzios@×××××.com> wrote:
5 > > > > On Saturday 04 Apr 2015 20:35:31 Alexander Kapshuk wrote:
6 > > > > > My portage summary logs don't seem to be rotated any more.
7 > > > > >
8 > > > > > ls -lt `pwd`/summary.log*
9 > > > > > -rw-rw-r-- 1 portage portage 96581 Apr 3 19:47
10 > > > > > /var/log/portage/elog/summary.log
11 > > > > > -rw-rw-r-- 1 portage portage 5927 Jan 10 07:50
12 > > > > > /var/log/portage/elog/summary.log-20150112
13 > > > > > -rw-rw-r-- 1 portage portage 2281 Jan 4 21:14
14 > > > > > /var/log/portage/elog/summary.log-20150104.gz
15 > > > > > -rw-rw-r-- 1 portage portage 565 Dec 26 20:53
16 > > > > > /var/log/portage/elog/summary.log-20141228.gz
17 > > > > > -rw-rw-r-- 1 portage portage 1842 Dec 22 17:52
18 > > > > > /var/log/portage/elog/summary.log-20141222.gz
19 > > > > >
20 > > > > > grep Messages summary.log | sed '1h;$!d;x;G;q'
21 > > > > >
22 > > > > > >>> Messages generated by process 3399 on 2015-01-13 17:47:47 EET
23 > > > > > >>> for
24 > > > > >
25 > > > > > package dev-python/reportlab-3.1.8-r2:
26 > > > > > >>> Messages generated by process 4080 on 2015-04-03 19:47:54 EEST
27 > >
28 > > for
29 > >
30 > > > > > package net-print/hplip-3.14.1:
31 > > > > >
32 > > > > > grep Messages summary.log-20150112 | sed '1h;$!d;x;G;q'
33 > > > > >
34 > > > > > >>> Messages generated by process 2637 on 2015-01-04 22:02:00 EET
35 > > > > > >>> for
36 > > > > >
37 > > > > > package app-office/libreoffice-4.2.8.2:
38 > > > > > >>> Messages generated by process 3483 on 2015-01-10 07:50:04 EET
39 > > > > > >>> for
40 > > > > >
41 > > > > > package dev-libs/openssl-1.0.1k:
42 > > > > >
43 > > > > > cat /etc/logrotate.d/elog-save-summary
44 > > > > > # Copyright 1999-2011 Gentoo Foundation
45 > > > > > # Distributed under the terms of the GNU General Public License v2
46 > > > > > # Rotate the log created by the save_summary elog module.
47 > > > > >
48 > > > > > /var/log/portage/elog/summary.log {
49 > > > > >
50 > > > > > su portage portage
51 > > > > > missingok
52 > > > > > nocreate
53 > > > > > delaycompress
54 > > > > >
55 > > > > > }
56 > > > > >
57 > > > > > /etc/logrotate.conf:6,8
58 > > > > > # rotate log files weekly.
59 > > > > > weekly
60 > > > > > #daily
61 > > > > >
62 > > > > > What could be wrong here? Or am I misreading something?
63 > > > > >
64 > > > > > Thanks.
65 > > > >
66 > > > > Is your logrotate running regularly as expected? What do you get
67 > > > > when
68 > > > >
69 > > > > from:
70 > > > > grep logrotate /var/log/cron.log
71 > > > >
72 > > > > --
73 > > > > Regards,
74 > > > > Mick
75 > > >
76 > > > Thanks for your response.
77 > > >
78 > > > I'm afraid I don't have the cron logging set up. I should probably go
79 > >
80 > > ahead
81 > >
82 > > > and do it, shouldn't I?
83 > > >
84 > > > grep logrotate /var/log/cron.log
85 > > > grep: /var/log/cron.log: No such file or directory
86 > > >
87 > > > The cron daemon is running though.
88 > > >
89 > > > ps auxwww|grep '[c]ron'
90 > > > root 2418 0.0 0.1 5464 1868 ? Ss 08:33 0:00
91 > > > /usr/sbin/crond
92 > > >
93 > > > Thanks.
94 > >
95 > > Ah! I must have set this up myself. In /etc/syslog-ng/syslog-ng.conf I
96 > > have
97 > > among other settings:
98 > >
99 > > destination cron { file("/var/log/cron.log"); };
100 > > filter f_cron { facility(cron); };
101 > > log { source(src); filter(f_cron); destination(cron); };
102 > >
103 > > This is not necessary though. You can search /var/log/messages for
104 > > logrotate.
105 > >
106 > > --
107 > > Regards,
108 > > Mick
109 >
110 > Understood. Thanks.
111 >
112 > Messages doesn't seem to have anything out of the ordinary to say about
113 > logrotate though.
114 > sed '/logrotate/!d' /var/log/messages
115 > Jan 13 17:50:02 localhost run-crons[7443]: (root) CMD
116 > (/etc/cron.daily/logrotate)
117 > Jan 14 18:00:02 localhost run-crons[4576]: (root) CMD
118 > (/etc/cron.daily/logrotate)
119 > Jan 15 18:10:02 localhost run-crons[1692]: (root) CMD
120 > (/etc/cron.daily/logrotate)
121 > Jan 16 18:20:01 localhost run-crons[4448]: (root) CMD
122 > (/etc/cron.daily/logrotate)
123 >
124 > An observation I've made, is that my log rotation seems to have effected
125 > all other logs in /var/log as well. It seems to have stopped working around
126 > January this year.
127 >
128 > ls -lt /var/log/messages*
129 > -rw------- 1 root root 9986127 Apr 5 16:10 /var/log/messages
130 > -rw------- 1 root root 173843 Jan 12 10:20 /var/log/messages-20150112.gz
131 > -rw------- 1 root root 277867 Jan 4 22:00 /var/log/messages-20150104.gz
132 > -rw------- 1 root root 132157 Dec 28 20:30 /var/log/messages-20141228.gz
133 > -rw------- 1 root root 142911 Dec 22 19:30 /var/log/messages-20141222.gz
134 >
135 > sed '1h;$!d;x;G;q' /var/log/messages
136 > Jan 12 10:20:02 localhost syslog-ng[2321]: Configuration reload request
137 > received, reloading configuration;
138 > Apr 5 16:10:01 box1 CROND[2265]: pam_unix(crond:session): session closed
139 > for user root
140 >
141 > ls -lt /var/log/|sort -k9
142 > total 16064
143 > drwxr-xr-x 2 root root 4096 Feb 15 00:42 ConsoleKit
144 > -rw-r--r-- 1 root sasha 33914 Apr 5 08:34 Xorg.0.log
145 > -rw-r--r-- 1 root sasha 34515 Apr 4 23:17 Xorg.0.log.old
146 > -rw-r--r-- 1 root sasha 28290 Sep 22 2014 Xorg.1.log
147 > drwxr-xr-x 2 root root 4096 Jan 12 10:20 chrony
148 > drwxr-xr-x 2 root root 4096 Feb 7 12:26 cups
149 > -rw-r----- 1 root root 50378 Apr 5 08:33 dmesg
150 > -rw-rw---- 1 portage portage 6268 Apr 1 19:35 emerge-fetch.log
151 > -rw-rw---- 1 portage portage 2687784 Apr 5 09:04 emerge.log
152 > -rw-r--r-- 1 root root 292292 Apr 5 08:34 lastlog
153 > -rw------- 1 root root 9986127 Apr 5 16:10 messages
154 > -rw------- 1 root root 142911 Dec 22 19:30 messages-20141222.gz
155 > -rw------- 1 root root 132157 Dec 28 20:30 messages-20141228.gz
156 > -rw------- 1 root root 277867 Jan 4 22:00 messages-20150104.gz
157 > -rw------- 1 root root 173843 Jan 12 10:20 messages-20150112.gz
158 > drwxr-xr-x 2 root root 4096 Dec 22 2013 openconnect
159 > -rw-r--r-- 1 root root 188788 Apr 5 08:34 pm-powersave.log
160 > -rw-r--r-- 1 root root 4837 Sep 30 2014
161 > pm-powersave.log-20141001.gz
162 > -rw-r--r-- 1 root root 785 Oct 31 07:35
163 > pm-powersave.log-20141101.gz
164 > -rw-r--r-- 1 root root 848 Dec 1 17:00
165 > pm-powersave.log-20141201.gz
166 > -rw-r--r-- 1 root root 67852 Jan 1 18:34 pm-powersave.log-20150101
167 > drwxrwsr-x 3 portage portage 4096 Oct 29 2013 portage
168 > -rw-r--r-- 1 root root 660096 Apr 5 08:33 rc.log
169 > -rw-r--r-- 1 root root 2705 Dec 22 17:37 rc.log-20141222.gz
170 > -rw-r--r-- 1 root root 2493 Dec 28 08:33 rc.log-20141228.gz
171 > -rw-r--r-- 1 root root 4003 Jan 4 19:51 rc.log-20150104.gz
172 > -rw-r--r-- 1 root root 3026 Jan 12 08:57 rc.log-20150112.gz
173 > drwxrwx--- 2 root portage 4096 Oct 29 2013 sandbox
174 > -rw------- 1 root root 64064 Apr 5 08:34 tallylog
175 > -rw-rw-r-- 1 root utmp 1792896 Apr 5 10:30 wtmp
176 > -rw-rw-r-- 1 root utmp 32029 Dec 25 17:04 wtmp-20141225.gz
177 >
178 > Any input on how to fix this would be much appreciated.
179
180 It seems to me that logrotate stopped rotating your logs back in Jan. Did you
181 change something in its configuration back then?
182
183 This is what I have in /etc/cron.daily/logrotate:
184 ================================================
185 #!/bin/sh
186
187 /usr/sbin/logrotate /etc/logrotate.conf
188 EXITVALUE=$?
189 if [ $EXITVALUE != 0 ]; then
190 /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
191 fi
192 exit 0
193 =================================================
194
195
196 PS. I leave previous message content untrimmed in case someone else spots
197 something of significance on what you have posted to date and can chime in
198 with a solution.
199
200 --
201 Regards,
202 Mick

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>