Subject: bug#898: systemctl-service-shim: Breaks automatic grub menu updating

From: "Plasma (David Paul)" <[email-masked]>
Date: Mon, 30 Jun 2025 13:13:55 -0500

Control: affects -1 grub2-common
Package: systemctl-service-shim
Version: 0.0.1
Severity: important
X-Debbugs-CC: [email-masked]

# Problem
If the systemctl-service-shim package is installed, the grub menu is
not automatically updated when a new linux kernel version is installed.

# Description
Following each linux kernel installation or update, the scripts in the
directory /etc/kernel/postinst.d are run in ascii-betical order.  When
the grub2-common package is installed, one of these scripts is the file
zz-update-grub which is responsible for updating the grub boot menu
entries to include an entry for the newly install kernel and to update
the default kernel option, as appropriate.

The zz-update-grub script starts with a few checks to verify that
certain conditions are met and, if not, it aborts. Relevant to this
bug, it checks to see whether it is running within a container and, if
so, it aborts.  The utility it uses to make this check is
systemd-detect-virt which, on Debian, comes from the systemd package.
systemd-detect-virt is one of the three utilities that
systemctl-service-shim provides compatibility shims for. However,
currently in the case of systemd-detect-virt, this is accomplished by
simply always returning with "exit 0".  As a result, the zz-update-grub
script always *erroneously* detects that it is running in a container
and always prematurely exits and never updates the grub menu.

(Note: The grub-legacy package also includes its own zz-update-grub
script for automatically updating the grub v1 menu, but it doesn't
check if it is running in a container (should it?), so it is not
affected by this issue.)

# Questions/Analysis
- What in Devuan currently requires systemd-detect-virt, and what
  functionality is required for its shim to provide?

  AFAICT, only the dummy-systemd-dev and python3-ipalib binary packages
  (from the dummy-systemd-dev and freeipa source packages,
  respectively) depend on the systemctl-service-shim package.

  Grepping for 'systemd-detect-virt' (or 'hostnamectl' for that matter)
  in the dummy-systemd-dev source code turns up nothing, so
  dummy-systemd-dev can be safely ignored.

  This leaves just the freeipa source package to evaluate. CC-ing
  bgstack15 to request his subject matter expertise in this regard.

- Currently, systemctl-service-shim provides shims for systemctl,
  hostnamectl, and systemd-detect-virt.  However, this is presently
  accomplished by having both systemd-detect-virt and hostnamectl be
  symlinks to the systemctl shim script, and simply checking the name
  under which the script was executed, and if that name was either of
  hostnamectl or systemd-detect-virt then merely terminate with an exit
  code of 0. Should these 2 scripts be independent of the systemctl
  script instead of being shoehorned onto the side? Are they even
  needed?

-- 
Plasma

---

From: "Devuan bug Tracking System" <[email-masked]>
Date: Wed, 02 Jul 2025 15:14:02 +0000

This is an automatic notification regarding your bug report
which was filed against the systemctl-service-shim package:

#898: systemctl-service-shim: Breaks automatic grub menu updating

It has been closed by [email-masked].

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact [email-masked] by
replying to this email.

-- 
898: https://bugs.devuan.org/cgi/bugreport.cgi?bug=898
Devuan Bug Tracking System
Contact [email-masked] with problems

Subject: #898: fixed in src:systemctl-service-shim version 0.0.8
From: [email-masked]
To: [email-masked]
Date: Wed, 02 Jul 2025 15:11:42 +0000

Version: 0.0.8

Source package systemctl-service-shim (0.0.8) added to Devuan suite unstable.

This closes bug report 898.

Thanks

DAK managing the Devuan archive

Format: 1.8
Date: Wed, 02 Jul 2025 11:01:18 -0400
Source: systemctl-service-shim
Architecture: source
Version: 0.0.8
Distribution: unstable
Urgency: medium
Maintainer: B. Stack <[email-masked]>
Changed-By: B. Stack <[email-masked]>
Closes: 898
Changes:
 systemctl-service-shim (0.0.8) unstable; urgency=medium
 .
   [ B. Stack ]
   * Remove hostnamectl and systemd-detect-virt stub behavior (Closes: #898)
   * d/control: add breaks python3-ipaclient << 4.12.4-1devuan1
Checksums-Sha1:
 36715e42cf45e046b7d40de05f5d04ee628f7e81 1442 systemctl-service-shim_0.0.8.dsc
 33ca8a1c02ff866c115944a1e01328b87a253c2f 16700 systemctl-service-shim_0.0.8.tar.xz
 1de5ae9a0ed836074b956de9f033e7cf33dc1a80 5618 systemctl-service-shim_0.0.8_source.buildinfo
Checksums-Sha256:
 cb3f679fb8fbfd3c964ea33b1e0b5e1322f4dd8cb88117e5dd13a97d991d257e 1442 systemctl-service-shim_0.0.8.dsc
 219892ceb76207799dfacc5438435ad53ada5e279b7eee9036025585822c70fc 16700 systemctl-service-shim_0.0.8.tar.xz
 77323d3cffd2fddc4d2c7294d76a59ee26acf1cbb48e20cbc0d249f9ef0b0c1e 5618 systemctl-service-shim_0.0.8_source.buildinfo
Files:
 cd2fe47da54f7ff2d10974fd96a3a23f 1442 admin optional systemctl-service-shim_0.0.8.dsc
 550e56aaaa8624aed0d73e767af690a8 16700 admin optional systemctl-service-shim_0.0.8.tar.xz
 9ef09c434effcd73571f6de35ec19bbe 5618 admin optional systemctl-service-shim_0.0.8_source.buildinfo

Subject: systemctl-service-shim: Breaks automatic grub menu updating
From: "Plasma (David Paul)" <[email-masked]>
To: Devuan Bug Tracking System <[email-masked]>
Date: Mon, 30 Jun 2025 13:13:55 -0500

# Problem

# Description

# Questions/Analysis

-- 
Plasma