Bug#1129339: apt hangs for 25 seconds before acting if logind isn't running

David Kalnischkies <[email protected]> Tue, 3 Mar 2026 12:01:24 +0100
Newsgroups gmane.linux.debian.apt.devel
Message-ID <aaa3cf804PhfJUir__16803.9309953869$1772535809$gmane$org@gosurf.lan>
Am Mon, Mar 02, 2026 at 11:52:34PM +0100, schrieb [email protected]:
> No need to use a chroot.  Elogind ships its manifest
> /usr/share/dbus-1/system-services/org.freedesktop.login1.service 
> 
>     [D-BUS Service]
>     Name=org.freedesktop.login1
>     # By default, Dbus activation of elogind is disabled. The daemon is started via an init script.
>     # Exec=/usr/libexec/elogind --daemon
>     Exec=/bin/true
>     User=root
> 
> which
> 
> - advertises elogind
> 
> - prevents dbus from attempting to start the daemon (by design, because
>   it lacks the necessary privileges)

But it is assuming that the daemon is running due to starting it via the
init script by default, which you have disabled (or wouldn't happen in
a chroot), I presume.

Instead of using `/bin/true` here it might be better to check if the
daemon is actually running and fail if not. I assume that would tell
dbus directly that the method isn't available rather than this pretend
of it having successfully started and hence providing the method for use
which `true` clearly does not.

Maybe something like:
`Exec=/usr/sbin/invoke-rc.d --disclose-deny elogind status`
works, but I haven't tested it, it is just a wild guess.

systemd-logind seems to use `/bin/false` here, indicating that my check
might be overkill and elogind could just use the same as, I guess, dbus
isn't executing that line if the service is already provided "somehow".
(But as said, no real dbus knowledge to speak of)

If you could test that and/or if that works I think it would be a lot
better to change elogind than to guess what a reasonable timeout may be
from our side (which is likely a lot longer still than "instant") as
that seems rather brittle.


Best regards

David Kalnischkies
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE5sn+Q4uCja/tn0GrMRvlz3HQeIMFAmmmv4MACgkQMRvlz3HQ
eIMXPhAApdc2TO09fcEA+aj1BUksf98/N27LukCTvs0TZik2GmEy5uA0qj/ZF3Zz
q3Su33yhUIcHC2khElGcCiJpLfDxCq3VrB1z1FOW0cvdzxOFUrIGTM8MK0g+BOr9
b/9n/RxP5xfEfQjhEMrMWuWMTNTvDfKT9Zo5NyBV836Yp2IRXBQsqfmrdbWrQYKx
lczhM2hKgAyC8Is1b+HWvPqLVp6LwC9KTPo1T+jZWAHgXgi3otBSdD/oN/fTOESC
VEtkJulxbvquggVPJTdBONto11+nkt65NIsJMKP7NDndriwMqlCXdh0+CL8JNM8T
p+N4jIXGqV4aMTJsYegBknWnP7vZl4ia3PrDnCZSvmuK2caVzO9To/rmgEIVqLyN
dZhWGp9E+n2MeRi4sdcPJ+u9yjcwedv3DLP/vE+xI8k2d/+g+O7FH4OMtpmbDy97
p0LcNRqaBgCPE7e/r+c61KlRR1HePdAuiZNR+oxrF8eUtL0KWg9GKnNzaVajrbbE
E5+ulkazWQwM0i/pEitIL4LnDKVXxgnFghQmMxKneu1WF8NxuYXnI9AhtJwEfyAa
R9Rt9DNuCT/cKA7nnWQ+lVnUhE6DjCVTwZrYXjjqnCkxnCEftpLKkyQ4DqyFV/UN
YOJ2TshjRfP4Zgn0Hs1BVj0qFn+aRlBvIeMc1j/yMWE4i9mPQjk=
=+gqM
-----END PGP SIGNATURE-----