[Bug 1969162] Re: bad interaction between snapd and update-notifier when snapd package is being upgraded
Alberto Mardegan
1969162 at bugs.launchpad.net
Fri Apr 15 05:56:32 UTC 2022
Hi Steve, thanks for reporting this, and for the hint on how to fix it.
We currently have a shell script in our prerm script, which manually
stops all our systemd units:
https://github.com/snapcore/snapd/blob/master/packaging/ubuntu-16.04/snapd.prerm
Do I correctly understand that your suggestion is not to do that?
I'm actually a bit confused (though this is probably a question for my
own team) why we have that prerm script, when we are already using
dh_systemd_start in out debian/rules file:
==============
override_dh_systemd_start:
# Due to https://github.com/systemd/systemd/issues/8102
# debhelper supporting --remaining like behaviour here would
# have been useful
# (Re-)start socket first
dh_systemd_start snapd.socket
# Then service
dh_systemd_start snapd.service
# Then the rest
dh_systemd_start $(filter-out snapd.socket snapd.service, $(shell ls debian/snapd/lib/systemd/system/))
==============
wouldn't this rule already cause the units to be stopped at the prerm
step (we are using debhelper compatibility level 9)?
Anyway, I'm soon going to propose a PR, so we can discuss over it.
** Bug watch added: github.com/systemd/systemd/issues #8102
https://github.com/systemd/systemd/issues/8102
** Changed in: snapd (Ubuntu)
Assignee: (unassigned) => Alberto Mardegan (mardy)
** Changed in: snapd (Ubuntu)
Importance: Undecided => High
** Changed in: snapd (Ubuntu)
Status: New => In Progress
--
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/1969162
Title:
bad interaction between snapd and update-notifier when snapd package
is being upgraded
Status in snapd package in Ubuntu:
In Progress
Status in update-notifier package in Ubuntu:
New
Bug description:
On a release upgrade from impish to jammy, I noticed that the dbus
postinst hung for 10 minutes. It hung trying to make two calls to
canonical-livepatch via /usr/share/update-notifier/notify-reboot-
required: first a call to /snap/bin/canonical-livepatch kernel-
upgrade-required which hung for ~5 minutes, then a call to
/snap/bin/canonical-livepatch status which hung for another ~5
minutes.
An strace of the second process showed that canonical-livepatch was
looping trying to connect to /run/snapd.socket:
[pid 769177] connect(3, {sa_family=AF_UNIX,
sun_path="/run/snapd.socket"}, 20) = -1 ECONNREFUSED (Connection
refused)
This was not attached to anything, because the snapd package was among
those in the current apt transaction, and was currently not in a
configured state:
root 756701 0.0 0.0 24144 12556 pts/20 Ss+ 17:26 0:00 |
| \_ /usr/bin/dpkg --force-overwrite --status-fd 57
--no-triggers --configure apparmor:amd64 openssl:amd64 ca-
certificates:all libmd0:amd64 libmd0:i386 libbsd0:amd64 libbsd0:i386
libedit2:amd64 libtinfo6:i386 libedit2:i386 libcbor0.8:amd64
libfido2-1:amd64 libkrb5support0:amd64 libkrb5-3:amd64 libgssapi-
krb5-2:amd64 openssh-client:amd64 liblzo2-2:amd64 squashfs-tools:amd64
libcap2:amd64 libkmod2:amd64 udev:amd64 libapparmor1:amd64
libapparmor1:i386 libdbus-1-3:amd64 libcap2:i386 libzstd1:i386
libsystemd0:i386 libdbus-1-3:i386 dbus:amd64 libpam-systemd:amd64
dbus-user-session:amd64 snapd:amd64
iU snapd 2.55.3+22.04 amd64 Daemon and tooling that
enable snap packages
This should probably be fixed by not stopping snapd in the prerm
(dh_systemd_start --restart-after-upgrade).
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1969162/+subscriptions
More information about the foundations-bugs
mailing list