[Bug 525674] Re: apt-check hangs, preventing login via SSH

ChristianEhrhardt 525674 at bugs.launchpad.net
Tue Oct 6 15:34:15 UTC 2015


Other MOTD plugins use caching, for example /usr/lib/update-notifier/update-motd-reboot-required does:
if [ -f /var/run/reboot-required ]; then
        cat /var/run/reboot-required
fi

Actually /usr/lib/update-notifier/update-motd-updates-available already uses "caching" like the others.
It stores its result in:
  /var/lib/update-notifier/updates-available
This is what the call to "/usr/lib/update-notifier/apt-check --human-readable" writes into

But it executes slow commands like find apt-check synchronously.
Yes a cron job might be nice, but it is rather "invasive" in changing the general behaviour maybe more than required.

Why not just executing the "slow parts" like find and apt-check asynchronously.
One can still evolve that approach later on an move (instead or additionally) the async part into a cron job if required.

It comes at "the risk" of having one outdated info on login.
But since updates don't change every second anyway it is probably better than waiting on each login.
Especially with all the examples made like scp tabbing, slow network and so on.

The atomicity issue with updating the temporary file already exists in
todays code with regards to concurrent logins. But we can improve that
as well by using a temporary file and mv.

The following are suggestions to fix it in trusty, vivid, wily and
upstream.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to update-notifier in Ubuntu.
https://bugs.launchpad.net/bugs/525674

Title:
  apt-check hangs, preventing login via SSH

Status in update-notifier package in Ubuntu:
  Confirmed

Bug description:
  Binary package hint: update-notifier

  While investigating protracted hangs in the remote login process, I
  noticed that apt-check is called to update the list of available
  updates and print the number of updatable packages in the MOTD. As it
  so happens, apt-check often hangs in mid-update, which effectively
  prevents remote login via SSH from taking place.

  ProblemType: Bug
  Architecture: i386
  Date: Mon Feb 22 12:20:16 2010
  DistroRelease: Ubuntu 10.04
  Package: update-notifier-common 0.96
  PackageArchitecture: all
  ProcEnviron:
   LANGUAGE=fi_FI.UTF-8
   PATH=(custom, user)
   LANG=fi_FI.UTF-8
   SHELL=/bin/bash
  ProcVersionSignature: Ubuntu 2.6.32-14.20-generic
  SourcePackage: update-notifier
  Uname: Linux 2.6.32-14-generic i686

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/525674/+subscriptions



More information about the foundations-bugs mailing list