Merge lp:~seb128/update-notifier/logs-no-ctime into lp:update-notifier

Proposed by Sebastien Bacher on 2016-05-26
Status: Merged
Merged at revision: 876
Proposed branch: lp:~seb128/update-notifier/logs-no-ctime
Merge into: lp:update-notifier
Diff against target: 44 lines (+12/-7)
2 files modified
debian/changelog (+10/-0)
src/update.c (+2/-7)
To merge this branch: bzr merge lp:~seb128/update-notifier/logs-no-ctime
Reviewer Review Type Date Requested Status
Michael Vogt 2016-05-26 Approve on 2016-06-07
Will Cooke (community) Approve on 2016-05-27
Ubuntu Core Development Team 2016-05-26 Pending
Review via email: mp+295806@code.launchpad.net

Commit Message

don't use the logs ctime information to decide if update-manager
needs to be started, the log rotation updates that one which means it's
never getting older than a week and the updater not started

Description of the Change

don't use the logs ctime information to decide if update-manager
needs to be started, the log rotation updates that one which means it's
never getting older than a week and the updater not started

To post a comment you must log in.
Will Cooke (willcooke) wrote :

LGTM

review: Approve
Michael Vogt (mvo) wrote :

Thanks, very good catch. Logrotate will set the mtime when rotating, but it can't do anything about the ctime so checking that is actually incorrect and you are right in removing it.

review: Approve
Michael Hudson-Doyle (mwhudson) wrote :

Is there a reason this hasn't been merged? (I'm patch pilot today so this is why I'm checking). Seems there's agreement to, so I can do it if it's just waiting...

Sebastien Bacher (seb128) wrote :

@mwhudson, no reason out of the fact that I didn't have slots to go back work on that upload since it was reviewed, I'm going to try to do that this week but if you want to handle it please feel free to do it

875. By Sebastien Bacher on 2016-06-29

src/update.c:
don't use the logs ctime information to decide if update-manager needs
to be started, the log rotation updates that one which means it's
never getting older than a week and the updater not started
(lp: #356152)

876. By Sebastien Bacher on 2016-06-29

releasing package update-notifier version 3.169

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2016-04-12 10:26:52 +0000
3+++ debian/changelog 2016-06-29 14:52:02 +0000
4@@ -1,3 +1,13 @@
5+update-notifier (3.169) yakkety; urgency=medium
6+
7+ * src/update.c:
8+ don't use the logs ctime information to decide if update-manager needs
9+ to be started, the log rotation updates that one which means it's
10+ never getting older than a week and the updater not started
11+ (lp: #356152)
12+
13+ -- Sebastien Bacher <seb128@ubuntu.com> Wed, 29 Jun 2016 16:48:24 +0200
14+
15 update-notifier (3.168) xenial; urgency=medium
16
17 * Also update motd, at the end of Dpkg-Post run, properly counting how
18
19=== modified file 'src/update.c'
20--- src/update.c 2014-01-16 00:26:52 +0000
21+++ src/update.c 2016-06-29 14:52:02 +0000
22@@ -456,7 +456,7 @@
23 }
24 for(j=0;j < pglob.gl_pathc; j++) {
25 const char *log = pglob.gl_pathv[j];
26- time_t mtime, bctime;
27+ time_t mtime;
28 gchar *timestamp;
29
30 if(g_stat(log, &buf) <0) {
31@@ -473,12 +473,7 @@
32 g_debug_update ("mtime from %s: %i (%s)", log, mtime, timestamp);
33 g_free (timestamp);
34
35- bctime = buf.st_ctime;
36- timestamp = readable_timestamp (bctime);
37- g_debug_update ("ctime from %s: %i (%s)", log, bctime, timestamp);
38- g_free (timestamp);
39-
40- newest_log_stamp = MAX(MAX(mtime, bctime), newest_log_stamp);
41+ newest_log_stamp = MAX(mtime, newest_log_stamp);
42 timestamp = readable_timestamp (newest_log_stamp);
43 g_debug_update ("last_launch from %s: %i (%s)", log, newest_log_stamp, timestamp);
44 g_free (timestamp);

Subscribers

People subscribed via source and target branches