[Bug 766827] Re: motd not updating
Thue Janus Kristensen
thuejk at gmail.com
Tue May 5 18:09:51 UTC 2015
*** This bug is a duplicate of bug 659738 ***
https://bugs.launchpad.net/bugs/659738
It is not the same problem as bug #659738.
The problem here is that /usr/lib/update-notifier/update-motd-updates-
available does
if [ "$(find "/$StateDir/$ListDir" "/$EtcDir/$SourceList" -type f -newer "$stamp" -print -quit)" ]; then
NEED_UPDATE_CHECK=yes
fi
So it checks in /var/lib/apt/lists if there are any files more newly
updated than /var/lib/update-notifier/updates-available , and if there
are it generates a new /var/lib/update-notifier/updates-available .
However, the timestamps on the files in /var/lib/apt/lists are kept in
sync with the timestamps on the mirrors, and do not indicate when an
"apt-get update" was last run. So the following can happen:
1) A new package appears on the mirrors, and the timestamp on the mirrors is updates
2) A new /var/lib/update-notifier/updates-available is generated on my computer
3) I run "apt-get update" on my computer
In that case, /usr/lib/update-notifier/update-motd-updates-available
will see /var/lib/update-notifier/updates-available as having a newer
timestamp than the package lists, and will therefore not update /var/lib
/update-notifier/updates-available.
The simplest fix is to have update-motd-updates-available just store the
package list directory listing with full time stamps. I have attached a
patch.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to update-motd in Ubuntu.
https://bugs.launchpad.net/bugs/766827
Title:
motd not updating
Status in update-motd package in Ubuntu:
Confirmed
Bug description:
Following recent updates, the /var/run/motd file is being updated
properly, but the data contained within is not. This refers
specifically to the data udpated by the following scripts:
/usr/lib/update-notifier/update-motd-cpu-checker
/usr/lib/update-notifier/update-motd-reboot-required
/usr/lib/update-notifier/update-motd-updates-available
I have verified this behaviour on several of our machines, all of
which are running Ubuntu Server 10.04.
I've manually run /usr/lib/update-notifier/apt-check --human-readable
(called from /usr/lib/update-notifier/update-motd-updates-available)
and it outputs accurate data:
it at milpat:~$ /usr/lib/update-notifier/apt-check --human-readable
0 packages can be updated.
0 updates are security updates.
Running the /usr/lib/update-notifier/update-motd-updates-available
script itself returns the appropriate data:
it at milpat:~$ sudo /usr/lib/update-notifier/update-motd-updates-available
0 packages can be updated.
0 updates are security updates.
it at milpat:~$
But even after running the script manually, the motd file does not
contain the new data:
dmcgarry at emigre:~/devel/goofalicious/src/Goofalicious$ ssh milpat
Linux milpat 2.6.32-4-pve #1 SMP Thu Oct 21 09:35:29 CEST 2010 x86_64 GNU/Linux
Ubuntu 10.04.2 LTS
Welcome to Ubuntu!
* Documentation: https://help.ubuntu.com/
8 packages can be updated.
2 updates are security updates.
You have mail.
Last login: Wed Apr 20 16:13:14 2011 from xxx.xxx.xxx.xxx
it at milpat:~$
REFERENCE SYSTEM INFO:
it at milpat:~$ lsb_release -rd
Description: Ubuntu 10.04.2 LTS
Release: 10.04
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/update-motd/+bug/766827/+subscriptions
More information about the foundations-bugs
mailing list