Bug#1009963: deb-systemd-helper: Misleading error message in "sub enable" if systemctl fails

Sascha Herrmann sh-bugs at ps.nvbi.de
Thu Apr 21 11:33:19 BST 2022


Package: init-system-helpers
Version: 1.60
Severity: normal
X-Debbugs-Cc: sh-bugs at ps.nvbi.de

Dear Maintainer,

the code line 'or error("systemctl preset failed on $scriptname: $!");' prints
some misleading information, if the systemctl command fails and returns an
return value != 0. When using the systemctl package (systemctl-replacement),
some packages fail to setup their service files, systemctl returns the error
code 1 which results in a message like

"/usr/bin/deb-systemd-helper: error: systemctl preset failed on keyboard-setup.service: No such file or directory"

The "No such file or directory" is produced by the $! part of the error string,
but $! isn't actually set by the system() call. The wrong (and random) error
messages gives wrong hints, when searching for the root cause of the problem
triggering the failure to install the service file. $! should only be used if
the system() call returned -1.

Thanks,
Sascha


-- System Information:
Debian Release: 11.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-9-amd64 (SMP w/1 CPU thread)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages init-system-helpers depends on:
ii  perl-base  5.32.1-4+deb11u2

init-system-helpers recommends no packages.

init-system-helpers suggests no packages.

Versions of packages init-system-helpers is related to:
pn  insserv  <none>

-- no debconf information



More information about the Pkg-systemd-maintainers mailing list