[systemd-devel] Running packagekitd on shutdown

Richard Hughes hughsient at gmail.com
Tue Aug 23 08:18:24 PDT 2011


Hello list, hello again Lennart,

I'm trying to make the update experience in GNOME 3.2 much better; at
the moment updating core services and libraries whilst everything is
running is quite unpredictable and we really just want to update stuff
like systemd, dbus and libc in shutdown when the system is in a known
and quiet state.

The UI we're going for can be seen in
https://live.gnome.org/GnomeOS/Design/Whiteboards/SoftwareUpdates?action=AttachFile&do=get&target=SoftwareUpdates.png

So, basically I want to run packagekitd and use plymouth to show the
shutdown status. I'm guessing I need to add a
file/lib/systemd/system/poweroff.target.wants/packagekit-updates.service
which has:

[Unit]
Description=Install updates at shutdown using PackageKit
DefaultDependencies=no
After=sysinit.target
Before=shutdown.target console-kit-log-system-start.service

[Service]
Type=oneshot
ExecStart=/usr/libexec/packagekitd-shutdown

And then hope that systemd starts the plymouth shutdown process at the
same time. Then in packagekitd-shutdown we send messages to plymouth
with what to update the screen with ("Installing update 1 of 3") and
then exit for the shutdown process to continue.

Note: packagekitd-shutdown will *only* be run if the user chooses the
"Shutdown and install updates" option from the user menu (rather than
'Suspend') and if the updates have already been downloaded and put in
the system cache. The packagekitd-shutdown process really only does
the bare metal update part which is really quite quick unless you're
updating 100's of packages.

Am I or the right lines, or am I on crack? systemd is still very magic
to me. Thanks.

Richard.


More information about the systemd-devel mailing list