PDA

View Full Version : [ubuntu] MOTD showing 3x amount of updates



smeerbartje
March 18th, 2014, 08:10 AM
When I log in to my server (12.04.4), I get the MOTD. However it's showing the amount of updates three times. Anyone else facing the same problem? And better: how to solve this?

Welcome to Ubuntu 12.04.4 LTS (GNU/Linux 3.8.0-37-generic i686)

* Documentation: https://help.ubuntu.com/

System information as of Tue Mar 18 08:07:13 CET 2014

System load: 0.37 Processes: 107
Usage of /: 55.3% of 1.34TB Users logged in: 0
Memory usage: 28% IP address for eth0: x.x.x.x
Swap usage: 4% IP address for eth1: x.x.x.x

Graph this data and manage this system at:
https://landscape.canonical.com/

1 package can be updated.
0 updates are security updates.

1 package can be updated.
0 updates are security updates.

1 package can be updated.
0 updates are security updates.

Last login: Mon Mar 17 15:34:38 2014 from blablabla.com

ian-weisser
March 18th, 2014, 02:17 PM
Has it always done this?
Or is this new?

TTY login (message-of-the-day [motd]) updates are triggered by /etc/init/mounted-run.conf
The content is generated by shell scripts in /etc/update-motd.d

tgalati4
March 18th, 2014, 03:13 PM
How many instances of Landscape do you have running?


ps aux | grep landscape

smeerbartje
March 18th, 2014, 09:02 PM
Only one instance running:
user@server:~$ ps aux | grep landscape
user 22054 0.0 0.0 4384 840 pts/4 S+ 20:55 0:00 grep --color=auto landscape

Anyone an idea what this does? /usr/lib/update-notifier/update-motd-updates-available

CharlesA
March 19th, 2014, 03:55 AM
Only one instance running:
user@server:~$ ps aux | grep landscape
user 22054 0.0 0.0 4384 840 pts/4 S+ 20:55 0:00 grep --color=auto landscape

Anyone an idea what this does? /usr/lib/update-notifier/update-motd-updates-available

Landscape isn't running and that script in /usr/lib is a python program meant to check for updates and notify you of them.

tgalati4
March 19th, 2014, 04:14 AM
I recall a bug that was fixed for this issue. Perhaps perform some updates and reboot.

smeerbartje
March 20th, 2014, 08:58 PM
How stupid :)... it was my grep command which appeared :).

Well, when I execute /usr/lib/update-notifier/update-motd-updates-available, then I get the following:

rogier@server:~$ /usr/lib/update-notifier/update-motd-updates-available

0 packages can be updated.
0 updates are security updates.

0 packages can be updated.
0 updates are security updates.

0 packages can be updated.
0 updates are security updates.

My system is completely up-to-date, contents of update-mots-updates-available is:

#!/bin/sh -e
#
# helper for update-motd


# poor mans force
if [ "$1" = "--force" ]; then
NEED_UPDATE_CHECK=yes
fi

# check time when we did the last udpate check
stamp="/var/lib/update-notifier/updates-available"
if [ -e "$stamp" ]; then
stampt=$(stat -c %Y $stamp)
else
stampt=0
fi

# get list dir
StateDir="/var/lib/apt/"
ListDir="lists/"
eval $(apt-config shell StateDir Dir::State)
eval $(apt-config shell ListDir Dir::State::Lists)

# check if we have a list file that needs checking
d="/$StateDir/$ListDir"
for f in $d/*; do
# ignore dirs
if [ ! -f $f ]; then
continue
fi
t=$(stat -c %Y $f)
if [ $t -gt $stampt ]; then
NEED_UPDATE_CHECK=yes
fi
done

# check if sources.list was modified since last check
EtcDir="etc/apt/"
SourceList="sources.list"
eval $(apt-config shell EtcDir Dir::Etc)
eval $(apt-config shell SourceList Dir::Etc::sourcelist)
if [ $(stat -c %Y "/$EtcDir/$SourceList") -gt $stampt ]; then
NEED_UPDATE_CHECK=yes
fi

# output something for update-motd
if [ -n "$NEED_UPDATE_CHECK" ]; then
echo "" > $stamp
/usr/lib/update-notifier/apt-check --human-readable >> $stamp
echo "" >> $stamp
fi

# output what we have (either cached or newly generated)
cat $stamp

smeerbartje
March 20th, 2014, 09:04 PM
Some additional information; I found this thread: https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/1146170
It looks like it's solved, but why am I still facing this error? (I'm up-to-date)

tgalati4
March 21st, 2014, 03:51 AM
Yes, that is the bug, but it looks like the patch was commited to Trusty (14.04). You can manually apply the patch or remove update notifier or just ignore the multiple messages.

Carefully follow the instructions in Post #2 of the bug tracker link and see if it goes away.

smeerbartje
March 21st, 2014, 07:21 AM
Thanks; I have changed the script by hand and it's working fine now. Why isn't 12.04.4 being patched thorough the official way??? It's LTS right?

ian-weisser
March 21st, 2014, 12:51 PM
There are two answers to that question.

1) See https://wiki.ubuntu.com/StableReleaseUpdates for how bugfixes get applied to a released version of Ubuntu. Including criteria and procedure.

2) For your specific bug, nobody has initiated the procedure. Feel free, if you are subscribed to the bug, to start the SRU process.

smeerbartje
March 21st, 2014, 03:36 PM
Thanks; I'll see what I can do...