Bug#1076530: Debian bug #1076530

Tomáš Szaniszlo tomaxuser at gmail.com
Thu Oct 30 20:04:23 GMT 2025


Hello,

I have also encountered this error message at least twice during upgrades.
In both cases, it was related to the upgrade of systemd-resolved (to 258-1
and to 258.1-2). To me it seems that some changes of the following line in
/usr/bin/deb-systemd-invoke would help debugging such issues:

    system('systemctl', '--quiet', @instance_args, $action, @start_units)
== 0 or die("Could not execute systemctl: $!");

This would be better as

    my @systemctl = ('systemctl', '--quiet', @instance_args, $action,
@start_units);
    system(@systemctl);
    $? == -1 and die("Could not execute systemctl (" . join(' ',
@systemctl) . ")");
    $? >> 8 != 0 and die("systemctl call (" . join(' ', @systemctl) . ")
failed, try checking journalctl.");

I'd say that in most cases "Could not execute systemctl" is misleading and
the systemctl call can be executed and only the units operated on fail to
(re)start.

The case of systemctl failing to execute (maybe some cgroup/ulimit/memory
exceeded?) can be detected by checking for ($? == -1) and only then using
the "Could not execute systemctl" message. The $! is useful here, but in
practice it seems (at least with my Perl 5.40.1) that the error message is
printed automatically, so it needn't be shown explicitly. However, the line
should still be there to show the failing command and for this case not to
be handled by the next/last line (which would be misleading).

Otherwise, do not use errno $! at all, since it is not relevant here.
Showing exit code ($? >> 8) would also not be helpful, since systemctl exit
codes carry little useful information.

Seeing which exact command that failed would help further hacking. Maybe it
is reproducible.

Recommend looking into system journal. At least in my case, I could see the
problem there.

Weirdly, man page for systemctl says that even with --quiet errors should
be printed, so no recommendation of journalctl checking should be
necessary, but that is not my case (with systemd 258.1-2) and only after
removing --quit I could see the red stderr message (so obviously a error
message?) 'Job failed. See "journalctl -xe" for details.'.

What do you think about the suggested changes?

Best wishes
Tomaxuser
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20251030/90130c13/attachment.htm>


More information about the Pkg-systemd-maintainers mailing list