#1014119 deb-systemd-helper fails with circular Also=

#1014119#5
Date:
2022-06-30 12:26:09 UTC
From:
To:
(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?

#1014119#10
Date:
2022-06-30 14:00:35 UTC
From:
To:
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

#1014119#25
Date:
2022-07-04 10:49:01 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
init-system-helpers, 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 1014119@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Luca Boccassi <bluca@debian.org> (supplier of updated init-system-helpers 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: Mon, 04 Jul 2022 11:19:08 +0100
Source: init-system-helpers
Architecture: source
Version: 1.64
Distribution: unstable
Urgency: medium
Maintainer: Debian systemd Maintainers <pkg-systemd-maintainers@lists.alioth.debian.org>
Changed-By: Luca Boccassi <bluca@debian.org>
Closes: 1014119
Changes:
 init-system-helpers (1.64) unstable; urgency=medium
 .
   * Team upload.
   * d-s-h: break infinite recursion on symlinks. (Closes: #1014119)
   * Bump Standards-Version to 4.6.1, no changes
   * Update date ranges in d/copyright
Checksums-Sha1:
 bf82acd1758c73868934568157ac73d25ac82a97 1993 init-system-helpers_1.64.dsc
 5349329661e0095f94d4881f921e7ec1dc378f06 43400 init-system-helpers_1.64.tar.xz
 c0bdc9d3dac6d5c8866145b6aefcc93b51df457e 6949 init-system-helpers_1.64_source.buildinfo
Checksums-Sha256:
 e2285c0f17182d85aceee57357bba65fe7007d62a0b9fc4ef7e5b10bcfadf1d9 1993 init-system-helpers_1.64.dsc
 79dee58d7cda9fac5de7e0045e1346b93cf079efc542db21c4bc16acc7358e2a 43400 init-system-helpers_1.64.tar.xz
 d5d53bfbbd9af1eb8819838ac8bb40625962da56bbe4d8f3879ab100045850c7 6949 init-system-helpers_1.64_source.buildinfo
Files:
 0190ef015ee177327cb685e309aae1aa 1993 admin optional init-system-helpers_1.64.dsc
 be6229c4c837480a359af63d5759aa0f 43400 admin optional init-system-helpers_1.64.tar.xz
 1dd553abbda8a2023f4b00eba1986f20 6949 admin optional init-system-helpers_1.64_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJFBAEBCgAvFiEErCSqx93EIPGOymuRKGv37813JB4FAmLCwjURHGJsdWNhQGRl
Ymlhbi5vcmcACgkQKGv37813JB72CRAAuwOYmPu3Y/p33DowYFlrIeAEwxdHgOu2
CZG+ypuxN7CQC9TdaCnKppRgzEy50aGn7Bp2Ja3fN15i22jjZ80GnCS2DaCktJxW
6Wqi/LKb8NVSZAKKg41E0uODje5bDvH7ebT6KiGG4lps/0IiAmPAlBHZ9WhX3wrd
JG917/s10khH73ottkRiSv3aVi6ZBXFDWY9M0x62iV3eTAP3gxZeuexFSLBS8phH
8vqR+8cUioSLgV9oVmhit+5WqsfhyHVJFgWr1flGvHYbGEcboPyBOx1LWpckN0p+
pao2Ja37PwCRa6wu+szD1mXB1ZlZgTuv9yBbVhXBLq052zAOp4F8scP08io+GYcV
V4/yQ6TTEXzTC8saia0gT/Z0UvzaaOjhRV03lxxz6h4wEO+0Wp8sOIVp9b1NG6RN
QlJEO7W0D9e+4thnzy1F+cviJA62Ucg8TslPISp6ATVetJydutIlErrjWzRiD6zw
5KMusWYksDh5MgXiGZS9boTtc02Hj7LONpXMkrYlEf4aAm4eWDPEQXWTQPoGnBgv
ObqKOT+yIjAXHCS7nCXI6Sj+FmaS7ZUQRwqxmxYahy7qTeFwkwYNwFHDlangqMMe
g2nLKEIUnzO5fHLwUltsZxZCeGa8QpqYJ48muV/Y1PO+p6snNsn5r+ehdml3wR9z
T/maKuK7Q0M=
=GsiB
-----END PGP SIGNATURE-----