- Package:
- systemd-homed
- Source:
- systemd
- Description:
- home area manager
- Submitter:
- Michael Biebl
- Date:
- 2022-07-06 22:57:06 UTC
- Severity:
- serious
- Tags:
(might be even RC, not properly cleaning up state on remove) # find systemd -name *home* -o -name *userdbd* # apt install systemd-homed Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: systemd-userdbd The following NEW packages will be installed: systemd-homed systemd-userdbd 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 621 kB of archives. After this operation, 1433 kB of additional disk space will be used. Do you want to continue? [Y/n] Get:1 http://ftp.debian.org/debian sid/main amd64 systemd-userdbd amd64 251.2-7 [150 kB] Get:2 http://ftp.debian.org/debian sid/main amd64 systemd-homed amd64 251.2-7 [471 kB] Fetched 621 kB in 0s (32.4 MB/s) Retrieving bug reports... Done Parsing Found/Fixed information... Done Selecting previously unselected package systemd-userdbd. (Reading database ... 498739 files and directories currently installed.) Preparing to unpack .../systemd-userdbd_251.2-7_amd64.deb ... Unpacking systemd-userdbd (251.2-7) ... Selecting previously unselected package systemd-homed. Preparing to unpack .../systemd-homed_251.2-7_amd64.deb ... Unpacking systemd-homed (251.2-7) ... Setting up systemd-userdbd (251.2-7) ... Created symlink /etc/systemd/system/sockets.target.wants/systemd-userdbd.socket -> /lib/systemd/system/systemd-userdbd.socket. Setting up systemd-homed (251.2-7) ... Created symlink /etc/systemd/system/systemd-homed.service.wants/systemd-homed-activate.service -> /lib/systemd/system/systemd-homed-activate.service. Created symlink /etc/systemd/system/dbus-org.freedesktop.home1.service -> /lib/systemd/system/systemd-homed.service. Created symlink /etc/systemd/system/multi-user.target.wants/systemd-homed.service -> /lib/systemd/system/systemd- homed.service. Deep recursion on subroutine "main::get_link_closure" at /usr/bin/deb-systemd-helper line 253, <$fh> line 23. /usr/bin/deb-systemd-helper: error: unable to read /lib/systemd/system/systemd-homed.service Deep recursion on subroutine "main::get_link_closure" at /usr/bin/deb-systemd-helper line 253, <$fh> line 41. /usr/bin/deb-systemd-helper: error: unable to read /lib/systemd/system/systemd-homed-activate.service Processing triggers for man-db (2.10.2-1) ... Processing triggers for dbus (1.14.0-1) ... [master 8d9b0a5] committing changes in /etc made by "apt install systemd-homed" Author: Michael Biebl <biebl@debian.org> 11 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 systemd/homed.conf create mode 120000 systemd/system/dbus-org.freedesktop.home1.service create mode 120000 systemd/system/multi-user.target.wants/systemd-homed.service create mode 120000 systemd/system/sockets.target.wants/systemd-userdbd.socket create mode 120000 systemd/system/systemd-homed.service.wants/systemd-homed-activate.service → Issue number one: Deep recursion on subroutine "main::get_link_closure" at /usr/bin/deb-systemd-helper line 253, <$fh> line 23. Now purging the package again: # apt purge systemd-homed Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages will be REMOVED: systemd-homed* 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 1172 kB disk space will be freed. Do you want to continue? [Y/n] (Reading database ... 498771 files and directories currently installed.) Removing systemd-homed (251.2-7) ... Processing triggers for dbus (1.14.0-1) ... Processing triggers for man-db (2.10.2-1) ... (Reading database ... 498749 files and directories currently installed.) Purging configuration files for systemd-homed (251.2-7) ... [master 9e93901] committing changes in /etc made by "apt purge systemd-homed" Author: Michael Biebl <biebl@debian.org> 7 files changed, 3 insertions(+), 28 deletions(-) delete mode 100644 systemd/homed.conf # find systemd -name *home* systemd/system/dbus-org.freedesktop.home1.service systemd/system/multi-user.target.wants/systemd-homed.service systemd/system/systemd-homed.service.wants systemd/system/systemd-homed.service.wants/systemd-homed-activate.service → Issue number two: Looks like none of the enablement symlinks has been removed. This might be a bug in i-s-h, but filing against systemd-homed for now. systemd-homed.service: [Install] WantedBy=multi-user.target Alias=dbus-org.freedesktop.home1.service Also=systemd-homed-activate.service systemd-userdbd.service systemd-homed-activate.service: [Install] WantedBy=systemd-homed.service Also=systemd-homed.service → we have a circular dependency here, maybe deb-systemd-helper get's confused by that systemd-userdbd.service: [Install] Also=systemd-userdbd.socket systemd-userdbd.socket: [Install] WantedBy=sockets.target → Another indirection @bluca, @fsateler: Any ideas?
Am 30.06.22 um 14:26 schrieb Michael Biebl: I just checked that we can mitigate this issue by removing this circular Also= dependency. It is indeed deb-systemd-helper getting confused by that and as a result not writing proper state files to /var/lib/systemd/deb-systemd-helper. So the damage is already done during installation in postinst. Thus raising to RC to warn users from installing systemd-homed atm. I propose a patch like the attached one, i.e. dropping the Also= from systemd-homed-active.service. WDYT? I've also cloned the issue for i-s-h, as we might want to fix that properly. My perl is a bit rusty, so would appreciate help with that. @bluca: do you think the attached patch is suitable for upstream? I find this circular Also= dependency kinda odd, I have to admit. Regards, Michael
I don't think so, this seems clearly a bug in i-s-h. Ideally we should really drop all of that and just use presets as RPMs do... but it's a lot of work. Kind regards, Luca Boccassi
Am 30.06.22 um 16:13 schrieb Luca Boccassi: Are you against shipping this patch for the time being until we have a proper fix? We have i-s-h/deb-systemd-helper for a couple of reasons (none of which can be solved by presets afaics) - distinction between uninstalled/purged state in Debian. We want to ensure that if you have a install/remove/install sequence, the enablement state of the service is preserved. For that we need to keep additional state, that is only removed on purge. If we remove the enablement symlinks on remove, we can't preserve the state. If we remove the enablement symlinks on purge, the service files are no longer around, so we can't do a proper cleanup. - masking a service upon uninstallation This is a sad reality, as packages still ship legacy SysV init scripts which are conffiles and would suddenly become active if a package is removed but not purged. I certainly would like to get rid of i-s-h, but I don't see how that is doable. Regards, Michael
Given the problem is that i-s-h doesn't generate the correct postinst, can we instead add a workaround to the postinst itself? i-s-h could be reduced to ship snippets that simply maintain this state after a remove till the next install/purge? At some point we should just nuke the sysv unit generator upstream. It's been 10+ years, there was plenty of time to add native units where needed. Then this becomes moot - the old init scripts would be just inert when booting under systemd.
Am 30.06.22 um 16:32 schrieb Luca Boccassi: No, it's not an incorrect postinst. The generated postinst code looks fine afaics. It's deb-systemd-helper failing in postinst [1] (due to the circular Also=) and subsequently not writing any state files to /var/lib/systemd/deb-systemd-helper (which means it can't clean up the state on purge). I'm pasting the error message again, for reference
I see, then could it be fixed in the postinst manually after the calls added by the helper?
Am 30.06.22 um 17:31 schrieb Luca Boccassi: I don't see how.
Am 30.06.22 um 16:32 schrieb Luca Boccassi: Dropping SysV init support would indeed solve that issue. $ apt-file search /etc/init.d/ | wc -l 1311 $ apt-file search /etc/init.d/ | cut -f1 -d':' | sort -u | wc -l 1180 So we have 1180 package shipping 1311 SysV init scripts. According to [1], we have 314 source packages which lack 365 service units. So our coverage is only about 72%. Dropping systemd-sysv-generator would break quite a lot of packages. Too many imho. Before we can do this, there should be a more active push to get the remaining packages migrated. A MBF seems like a good first step. This needs someone though to actively work on this. Any volunteers? [1] https://lintian.debian.org/tags/missing-systemd-service-for-init.d-script
Am 30.06.22 um 18:18 schrieb Michael Biebl: shell what deb-systemd-helper is doing in perl and creating the state files ourselves. Feasible, yes. Doable, I'd say no. I'd rather prefer a one-line patch.
The problem is some files leftover, no? Just delete them in the postinst or postrm?
Am 30.06.22 um 22:31 schrieb Luca Boccassi: My main motivation is to "stop the bleeding" as quickly as possible. If we continue to create those broken state files, we'd have to keep those postinst/postrm cleanup routines for a possibly long time.
I'd rather just fix i-s-h, here's a MR, it fixes the issue for me, can you give it a go as well please? I'll do an upload once it's confirmed and reviewed https://salsa.debian.org/debian/init-system-helpers/-/merge_requests/21 Kind regards, Luca Boccassi
Am 02.07.22 um 18:30 schrieb Luca Boccassi: Thank you, bluca. Without having tested it and without knowing Perl very well, the MR looks ok to me. I think Felipe is a bit more familiar with Perl, so if he could give his ack, that would be good I think. Cheers, Michael
I have uploaded i-s-h, should we close this one now? Kind regards, Luca Boccassi
Am 04.07.22 um 12:36 schrieb Luca Boccassi: I've seen the upload. Thanks! I was debating with myself whether systemd-homed should get a tightened, versioned Depends on i-s-h to prevent this issue from happening. This would make a backport a bit harder, but maybe a stable upload of i-s-h with this fix is a good idea anyway? Regards, Michael
It's a new package and optional, so maybe it's not worth it - but up to you, if you want to add that and a backport to be safer, I don't have any objection. Kind regards, Luca Boccassi
Am 04.07.22 um 13:13 schrieb Luca Boccassi: Ok, I'll add the versioned Depends on i-s-h then and also make a corresponding backports upload. That's the least I can do. I'm currently working on a systemd v251 backport and would include this change there as well. Regards and thanks again for the i-s-h fix, Michael
Hello, Bug #1014115 in systemd reported by you has been fixed in the Git repository and is awaiting an upload. You can see the commit message below and you can check the diff of the fix at: https://salsa.debian.org/systemd-team/systemd/-/commit/dd0c655fa5ff1c65ef0ed1dd427fa3b2a66c9bc1 ------------------------------------------------------------------------ Add versioned dependency on init-system-helpers to systemd-homed Ensure that we have a version of deb-systemd-helper which properly handles loops in Also= dependencies. Closes: #1014115 ------------------------------------------------------------------------ (this message was generated automatically) -- Greetings https://bugs.debian.org/1014115
We believe that the bug you reported is fixed in the latest version of
systemd, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 1014115@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Michael Biebl <biebl@debian.org> (supplier of updated systemd package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 06 Jul 2022 21:23:38 +0200
Source: systemd
Architecture: source
Version: 251.2-8
Distribution: unstable
Urgency: medium
Maintainer: Debian systemd Maintainers <pkg-systemd-maintainers@lists.alioth.debian.org>
Changed-By: Michael Biebl <biebl@debian.org>
Closes: 1014115
Changes:
systemd (251.2-8) unstable; urgency=medium
.
* autopkgtest: install openssl for upstream test.
Install openssl explicitly and do not rely on other packages, like
swtpm-libs, to pull this dependency for us.
Used by TEST-50-DISSECT, which otherwise just silently skips the test.
* Add versioned dependency on init-system-helpers to systemd-homed.
Ensure that we have a version of deb-systemd-helper which properly
handles loops in Also= dependencies. (Closes: #1014115)
* Demote shlibs dependencies of libsystemd0 from Pre-Depends to Depends.
As systemctl, which is quasi-essential, no longer links against
libsystemd0, we do not need those strict requirements anymore.
* Work around some more dh_installman issues
Checksums-Sha1:
2716a64011757c6d51cba245fca0ba767aae671a 6150 systemd_251.2-8.dsc
e8b790d7aad4a3d43d7524328a23225c2be44fb9 172768 systemd_251.2-8.debian.tar.xz
fe6f6d61912cadf1c881b91badb158407d07fe7e 10508 systemd_251.2-8_source.buildinfo
Checksums-Sha256:
d113bf44c6cb5908ad2026c68103ffdc9b59b25a64b6867698fd0d394183f3e8 6150 systemd_251.2-8.dsc
f139e2c9dd037077432d85efc3d17f97819ba62a4b702774add5b27c49fe53d8 172768 systemd_251.2-8.debian.tar.xz
6c9e028ce6d6105a4ac99a81d2f0d7673cc806b64fb7488d79aa4668980c4345 10508 systemd_251.2-8_source.buildinfo
Files:
50141c07a4c9b1a478d7edc3cf961f4c 6150 admin optional systemd_251.2-8.dsc
225f950613bd78eb68b8927e4d564411 172768 admin optional systemd_251.2-8.debian.tar.xz
69bf4b643dbccfedb91d0d76f43d5b51 10508 admin optional systemd_251.2-8_source.buildinfo
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEECbOsLssWnJBDRcxUauHfDWCPItwFAmLGCVcACgkQauHfDWCP
ItzLCBAAh7qSy7MC7P40G4z0IqBo8Q6MB3Y5+v+9l3HZ4VPfNeIzMhxCkF8qLCAu
CvHVuaVXdvL+utz/734jJqw/HQyjcj0JIUcp/3W96OSvS6YBFIY0MYEzZZz/RInW
YaswVGvEUDyw6OBaGyX5z2rTJ63aXQeW+sDqECgXHvjIDRVXVYFJiyLMefcVlkGv
EogvWdOl7qXk3rzBkhp1iLvEk7IxEZZ+hXEksJXCqtnzshluPcsTnFUd2wLLUftN
g2x8t8ZU/L15lulPKFwzsJEaxaSOiH+824oznmBFxzRBUNEzKpIiYf4oZlGbUlH7
w878g1M8xDKAy8b59PmEn7qcoarkRP6oPyIYp+Bm1TC3HWd4qIiozRl0In6UPBom
G9jPQkNYRop+melQ9y4z5yhnstAD8Ke3NZGWq6SqwQAGvpLqt2JW/vVdmGqcmUEF
C3x+eb2azJ1SUrE4vYnC+Rr98wH7t6R3BtOuIw3AtkJpFE4byUQTj+76xTKVlA2v
shyLH1oCnWJwAN8RWhKLPC6oSWW60Cflki6XD54AlRHRi71287rIoxPwvQC7I9oz
eZCXhmbT9+taoawKRsjkHcWJrklXh0eflZOMZff1oQmexY09whPjSJmv/j/41uZ+
yAfs4R00CM+PEvUKA44Bwq7eWFlydVE63Z5SY3WI7QrBoejxOto=
=8x7Z
-----END PGP SIGNATURE-----