diff -Nru update-notifier-3.160/data/update-motd-updates-available update-notifier-3.160ubuntu1/data/update-motd-updates-available --- update-notifier-3.160/data/update-motd-updates-available 2015-01-20 10:33:30.000000000 +0100 +++ update-notifier-3.160ubuntu1/data/update-motd-updates-available 2015-10-06 15:55:50.000000000 +0200 @@ -23,25 +23,37 @@ eval "$(apt-config shell EtcDir Dir::Etc)" eval "$(apt-config shell SourceList Dir::Etc::sourcelist)" -# check if we have a list file or sources.list that needs checking -if [ -e "$stamp" ]; then - if [ "$(find "/$StateDir/$ListDir" "/$EtcDir/$SourceList" -type f -newer "$stamp" -print -quit)" ]; then - NEED_UPDATE_CHECK=yes - fi -else - if [ "$(find "/$StateDir/$ListDir" "/$EtcDir/$SourceList" -type f -print -quit)" ]; then - NEED_UPDATE_CHECK=yes - fi +# avoiding stalls on login +# output what we have cached and asynchronously generate an update +if [ -f "$stamp" ]; then + cat "$stamp" fi -# output something for update-motd -if [ -n "$NEED_UPDATE_CHECK" ]; then - { - echo "" - /usr/lib/update-notifier/apt-check --human-readable - echo "" - } > $stamp -fi +cleanup() { rm -f "$tmpfile"; } -# output what we have (either cached or newly generated) -cat "$stamp" +( + # check if we have a list file or sources.list that needs checking + if [ -e "$stamp" ]; then + if [ "$(find "/$StateDir/$ListDir" "/$EtcDir/$SourceList" -type f -newer "$stamp" -print -quit)" ]; then + NEED_UPDATE_CHECK=yes + fi + else + if [ "$(find "/$StateDir/$ListDir" "/$EtcDir/$SourceList" -type f -print -quit)" ]; then + NEED_UPDATE_CHECK=yes + fi + fi + + trap cleanup EXIT + tmpfile=$(mktemp) + + # output something for update-motd + if [ -n "$NEED_UPDATE_CHECK" ]; then + { + + echo "" + /usr/lib/update-notifier/apt-check --human-readable + echo "" + } > "$tmpfile" + mv "$tmpfile" "$stamp" + fi +) & diff -Nru update-notifier-3.160/debian/changelog update-notifier-3.160ubuntu1/debian/changelog --- update-notifier-3.160/debian/changelog 2015-01-20 10:34:47.000000000 +0100 +++ update-notifier-3.160ubuntu1/debian/changelog 2015-10-06 16:11:20.000000000 +0200 @@ -1,3 +1,10 @@ +update-notifier (3.160ubuntu1) vivid; urgency=medium + + * data/update-motd-updates-available: avoid login stalls due to motd updates + executing the slow part of the update asynchronously (LP: #525674) + + -- Christian Ehrhardt Tue, 06 Oct 2015 16:06:55 +0200 + update-notifier (3.160) vivid; urgency=medium * ./debian/update-notifier-cds.conf: Stop asking udisks 1 for the