Bug#1009963: deb-systemd-helper: Misleading error message in "sub enable" if systemctl fails
Michael Biebl
biebl at debian.org
Thu Apr 21 18:08:26 BST 2022
Am 21.04.22 um 18:37 schrieb Ansgar:
> Hi,
>
> On Thu, 2022-04-21 at 18:13 +0200, Michael Biebl wrote:
>>
>> So /usr/bin/systemctl is provided by the "systemctl" package?
>> Can you post the output of apt-cache policy systemctl
>
> I think the bug reporter suggest to replace the
>
> system(...) == 0 or error("systemctl preset failed on $scriptname: $!");
>
> with a more correct (and verbose)
>
> system(...);
> if ($? == -1) {
> error("systemctl preset failed on $scriptname: $!");
> }
> elsif ($? & 127) {
> error("systemctl preset died with signal " . ($? & 127));
> }
> else {
> error("systemctl preset failed with return status " . ($? >> 8));
> }
>
> as `perldoc -f system` suggest. (Untested, so might contain typos and
> the like.)
>
> Currently it always give "$!" as the reason, even when not correct.
> This would also be incorrect if the real systemctl is used if the
> command fails because of syntax errors or so.
Thanks for the additional information, Ansgar.
I guess we have two issues then:
- systemctl (from docker-systemctl-replacement) most likely not being
compatible with the real systemctl
- handling of the return code from system()
We do have quite a few calls to system() in our perl code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20220421/bcdcf004/attachment.sig>
More information about the Pkg-systemd-maintainers
mailing list