#1056137 systemd: downgrading systemd packages kills off the desktop environment

Package:
systemd
Source:
systemd
Description:
system and service manager
Submitter:
Christoph Anton Mitterer
Date:
2024-02-29 10:57:02 UTC
Severity:
normal
Tags:
#1056137#5
Date:
2023-11-17 13:40:05 UTC
From:
To:
Hey.

Because of #1056135 I was downgradin systemd/udev packages to 254.5-1.
While apt was still running, this causes the whole desktop environment
(I use cinnamon) to be killed (and all processes in it ;-) ).

Tried it twice, happened twice.


/var/log/apt/term.log goes as far as:

Log started: 2023-11-17  13:44:52
dpkg: warning: downgrading udev from 255~rc2-1 to 254.5-1
(Reading database ... 472653 files and directories currently installed.)
Preparing to unpack .../0-udev_254.5-1_amd64.deb ...
Unpacking udev (254.5-1) over (255~rc2-1) ...
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system/systemd-udevd.service.d': Directory not empty
dpkg: warning: downgrading libnss-systemd:amd64 from 255~rc2-1 to 254.5-1
Preparing to unpack .../1-libnss-systemd_254.5-1_amd64.deb ...
Unpacking libnss-systemd:amd64 (254.5-1) over (255~rc2-1) ...
dpkg: warning: downgrading libpam-systemd:amd64 from 255~rc2-1 to 254.5-1
Preparing to unpack .../2-libpam-systemd_254.5-1_amd64.deb ...
Unpacking libpam-systemd:amd64 (254.5-1) over (255~rc2-1) ...
dpkg: warning: unable to delete old directory '/usr/lib/x86_64-linux-gnu/security': Directory not empty
dpkg: warning: downgrading systemd from 255~rc2-1 to 254.5-1
Preparing to unpack .../3-systemd_254.5-1_amd64.deb ...
Unpacking systemd (254.5-1) over (255~rc2-1) ...
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system-preset': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system-generators': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system/user@0.service.d': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system/user@.service.d': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system/user-.slice.d': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system/timers.target.wants': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system/systemd-localed.service.d': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system/sysinit.target.wants': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system/rescue.target.wants': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system/rc-local.service.d': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system/initrd.target.wants': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system/initrd-root-fs.target.wants': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system/initrd-root-device.target.wants': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system/graphical.target.wants': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system/getty.target.wants': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/network': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/journald.conf.d': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/modprobe.d': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/lsb/init-functions.d': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/lsb': Directory not empty
dpkg: warning: downgrading systemd-dev from 255~rc2-1 to 254.5-1
Preparing to unpack .../4-systemd-dev_254.5-1_all.deb ...
Unpacking systemd-dev (254.5-1) over (255~rc2-1) ...
dpkg: warning: downgrading libudev1:amd64 from 255~rc2-1 to 254.5-1
Preparing to unpack .../5-libudev1_254.5-1_amd64.deb ...
Unpacking libudev1:amd64 (254.5-1) over (255~rc2-1) ...
Setting up libudev1:amd64 (254.5-1) ...
dpkg: warning: downgrading libsystemd-shared:amd64 from 255~rc2-1 to 254.5-1
(Reading database ... 472565 files and directories currently installed.)
Preparing to unpack .../libsystemd-shared_254.5-1_amd64.deb ...
Unpacking libsystemd-shared:amd64 (254.5-1) over (255~rc2-1) ...
Setting up libsystemd-shared:amd64 (254.5-1) ...
dpkg: warning: downgrading libsystemd0:amd64 from 255~rc2-1 to 254.5-1
(Reading database ... 472565 files and directories currently installed.)
Preparing to unpack .../libsystemd0_254.5-1_amd64.deb ...
Unpacking libsystemd0:amd64 (254.5-1) over (255~rc2-1) ...
Setting up libsystemd0:amd64 (254.5-1) ...
Setting up systemd-dev (254.5-1) ...
Setting up systemd (254.5-1) ...
Installing new version of config file /etc/systemd/journald.conf ...

Configuration file '/etc/systemd/logind.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** logind.conf (Y/I/N/O/D/Z) [default=N] ?
Installing new version of config file /etc/systemd/networkd.conf ...
Installing new version of config file /etc/systemd/pstore.conf ...

Configuration file '/etc/systemd/sleep.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** sleep.conf (Y/I/N/O/D/Z) [default=N] ?
Installing new version of config file /etc/systemd/system.conf ...
Installing new version of config file /etc/systemd/user.conf ...
dpkg: warning: downgrading systemd-sysv from 255~rc2-1 to 254.5-1
(Reading database ... 472565 files and directories currently installed.)
Preparing to unpack .../systemd-sysv_254.5-1_amd64.deb ...
Unpacking systemd-sysv (254.5-1) over (255~rc2-1) ...
dpkg: warning: downgrading libnss-mymachines:amd64 from 255~rc2-1 to 254.5-1
Preparing to unpack .../libnss-mymachines_254.5-1_amd64.deb ...
Unpacking libnss-mymachines:amd64 (254.5-1) over (255~rc2-1) ...
dpkg: warning: downgrading systemd-container from 255~rc2-1 to 254.5-1
Preparing to unpack .../systemd-container_254.5-1_amd64.deb ...
Unpacking systemd-container (254.5-1) over (255~rc2-1) ...
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system/remote-fs.target.wants': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/system/machines.target.wants': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/portable/profile/trusted': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/portable/profile/strict': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/portable/profile/nonetwork': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/portable/profile/default': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/portable/profile': Directory not empty
dpkg: warning: unable to delete old directory '/usr/lib/systemd/portable': Directory not empty
Setting up systemd-sysv (254.5-1) ...
Setting up libnss-systemd:amd64 (254.5-1) ...
Setting up udev (254.5-1) ...
Installing new version of config file /etc/udev/iocost.conf ...
Setting up systemd-container (254.5-1) ...
Setting up libpam-systemd:amd64 (254.5-1) ...
Setting up libnss-mymachines:amd64 (254.5-1) ...
Processing triggers for initramfs-tools (0.142) ...
update-initramfs: Generating /boot/initrd.img-6.5.0-4-amd64
W: Possible missing firmware /lib/firmware/i915/mtl_huc_gsc.bin for module i915
W: Possible missing firmware /lib/firmware/i915/mtl_guc_70.bin for module i915
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/cat'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/cpio'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/dd'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/dmesg'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/false'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/gunzip'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/kill'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/ln'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/ls'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/mkdir'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/mkfifo'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/mknod'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/mount'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/mv'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/nuke'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/readlink'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/resume'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/sh'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/sleep'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/sync'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/true'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/umount'
cp: not replacing '/var/tmp/mkinitramfs_uDVbPV/bin/uname'
Processing triggers for libc-bin (2.37-12) ...
Processing triggers for man-db (2.12.0-1) ...
Processing triggers for dbus (1.14.10-3) ...


There the term.log ends (maybe apt is killed?).

I do have needrestart installed, but that happends even before
needrestart runs.


Thanks,
Chris.

#1056137#10
Date:
2023-11-17 14:03:28 UTC
From:
To:
Control: tags -1 moreinfo
1.
environment

Please attach the journal from around the time where the installation
was happening

#1056137#17
Date:
2023-11-17 14:31:07 UTC
From:
To:
Hey Luca.

Please see the attached file.

Also I just remembered, that with 255~rc2-1, and after it happened that
downgrading killed my DE session... I logged into Cinnamon again, and
when *then* pressing the power button, it wasn't even like in #1056135,
that *only* the Hibernation button was missing, but *no* pop-up dialog
(with at least Suspend, Cancel, Restart, Shutdown) showed up, and it
went straight without any further confirmation into shutdown.

Cheers,
Chris.

#1056137#24
Date:
2023-11-17 14:37:46 UTC
From:
To:
Am 17.11.23 um 15:31 schrieb Christoph Anton Mitterer:
They might just work most of the time for more trivial packages, but
often they don't (e.g. because data structures have changed that are
converted on upgrades but not on downgrades).


Regards,
Michael

#1056137#29
Date:
2023-11-17 14:41:09 UTC
From:
To:
Sure... and if it's not fixable... well then it's not. But at least it
would be better then to abort the downgrade if it's detected that e.g.
a DE is running.
In my case it didn't matter but people may have important/unsaved data
open.

And maybe there is just some accidental restart of dbus or so involved
(that usually kills of the DE, too).


Cheers,
Chris.

#1056137#34
Date:
2024-02-28 17:37:41 UTC
From:
To:
Hi Christoph

I acknowledge that not being able to downgrade is a nuisance.
systemd is not special in that regard though. Quite a few packages that
I now need to convert their on-disk-files on upgrades to a new format
which is not easily reversible.
None of those packages have explicit maintainer scripts code though,
which would prevent a downgrade.
So we do not plan to add maintainer scripts code in systemd either.

My guess is, that the failures you encountered are due to the following
change in v255:

"""
         Service Manager:

         * The way services are spawned has been overhauled. Previously, a
           process was forked that shared all of the manager's memory (via
           copy-on-write) while doing all the required setup (e.g.: mount
           namespaces, CGroup configuration, etc.) before exec'ing the
target
           executable. This was problematic for various reasons: several
glibc
           APIs were called that are not supposed to be used after a
fork but
           before an exec, copy-on-write meant that if either process (the
           manager or the child) touched a memory page a copy was
triggered, and
           also the memory footprint of the child process was that of the
           manager, but with the memory limits of the service. From this
version
           onward, the new process is spawned using CLONE_VM and CLONE_VFORK
           semantics via posix_spawn(3), and it immediately execs a new
internal
           binary, systemd-executor, that receives the configuration to
apply
           via memfd, and sets up the process before exec'ing the target
           executable. The systemd-executor binary is pinned by file
descriptor
           by each manager instance (system and users), and the reference is
           updated on daemon-reexec - it is thus important to reexec all
running
           manager instances when the systemd-executor and/or libsystemd*
           libraries are updated on the filesystem.
"""

This is just a guess though.
There is only so much we can do as Debian systemd team. If that issue is
important to you, please consider investigating this further and
providing patches, ideally via a MR on salsa.

Michael

#1056137#43
Date:
2024-02-28 21:22:34 UTC
From:
To:
I couldnt follow the bit i deleted, and this maybe jumping to
conclusions: are there any implications for upgrading to/after 255
within a desktop environment?
should something be said in the release-notes?

#1056137#48
Date:
2024-02-29 10:56:07 UTC
From:
To:
Am 28.02.24 um 22:22 schrieb Richard Lewis:

No, upgrades should work fine.
That said, the usual recommendations for dist-upgrades apply
https://www.debian.org/releases/stable/amd64/release-notes/ch-upgrading.en.html#upgrade-preparations

I.e. it is generally not recommended to dist-upgrade from within a
desktop session although usually it works.