MaverickUpdateNotifierRefactor

Summary

update-notifier has grown to do much more than just update notifications. Because it is always available in the session and is small and easy to extend it got a lot of features that are outside of its core. Therefore it should be refactored/replaced.

Rationale

When upstart provides support to run as the user in the user session it much better to move the features that update-notifier is doing to upstart events.

Design

In order to replace update-notifier as the app that runs permanently in the session the following features are needed.

General

Needs to be able to know if the user has a X session.

Ideally can test if the user is part of a special group (like admin). This can be done in the script itself too, but its of course cheaper if it can be checked in the upstart script.

Throttle would be nice, i.e. not running a script more often than every 5 min even if a condition happens more frequently (but is absolutly not important).

Some stuff (like check for pending updates) needs to be run on session login and then when certain events happen. I guess its fine to just have two job files for this.

File/directory monitoring

When dpkg was run the following file is touched:

  • /var/lib/update-notifier/dpkg-run-stamp"

When apt-get update was run:

  • /var/lib/apt/periodic/update-success-stamp

When a file in the hooks directory changes:

  • /var/lib/update-notifier/user.d/

On reboot required:

  • /var/run/reboot-required

On new crashreports:

  • /var/crash/

On new avahi warning

  • /var/run/avahi-daemon/disabled-for-unicast-local

Hardware monitoring

When a CD/usb-stick is inserted, run a action (currently uses gdu and the "device-changed" signal there.

Periodic events

The maverick update-notifier checks for a new release every 48h by running a small script.

act on uevents

The firmware loader acts on idVendor=03f0, idProduct="??17" for hp printer firmware or on g_udev_device_get_property (device, "FIRMWARE")


CategorySpec

FoundationsTeam/Specs/MaverickUpdateNotifierRefactor (last edited 2010-10-14 18:43:43 by 99-156-85-10)