Bug#1087031: deb-systemd-helper is-enabled returns wrong result if dependent services are disabled

Marco Schmidt marco.schmidt at gmail.com
Sat Nov 16 14:46:37 GMT 2024


Hello Luca,
Thanks for looking into it and sorry for the delay.

As mentioned in my report it is in the script "deb-systemd-helper" in
the Debian package "init-system-helpers".
Via git you can find the newest version  under this link.
https://salsa.debian.org/debian/init-system-helpers/-/blob/master/script/deb-systemd-helper

In line 614 it calls "all_links_installed", which calls in line 289
the function "get_link_closure".
In "get_link_closure" it loops recursively over all systemd services
referenced via "Wanted-By", "Required-by", "Also" and "Alias".

I think the "Also" is not correct, because "Also" says, if you start
this service start the also-service, too.
But the also-service does not need to be active to mark a service as active.

Hope this helps further.

As I am a sysadmin I can read/debug code, but are not able to provide
a stable solution.

Quick and dirty I would ask "systemctl is-enabled" instead of checking
the links.
https://github.com/systemd/systemd/blob/main/src/systemctl/systemctl-is-enabled.c

Greetings ...
Marco

Am Fr., 8. Nov. 2024 um 20:33 Uhr schrieb Luca Boccassi <bluca at debian.org>:
>
> Control: tags -1 moreinfo
>
> On Fri, 8 Nov 2024 12:40:55 +0100 Marco Schmidt
> <marco.schmidt at gmail.com> wrote:
> > Package: init-system-helpers
> > Version: master branch
>> ...
>
> In which package's maintainer script is this a problem?
>



More information about the Pkg-systemd-maintainers mailing list