Devuan bug report logs - #898
systemctl-service-shim: Breaks automatic grub menu updating

version graph

Package: systemctl-service-shim; Maintainer for systemctl-service-shim is B. Stack <bgstack15@gmail.com>; Source for systemctl-service-shim is src:systemctl-service-shim.

Affects: grub2-common

Reported by: "Plasma (David Paul)" <davidpaul@librem.one>

Date: Mon, 30 Jun 2025 18:16:01 UTC

Severity: critical

Found in version 0.0.1

Fixed in version 0.0.8

Done: dak@devuan.org

Full log


Message #5 received at submit@bugs.devuan.org (full text, mbox, reply):

Received: (at submit) by bugs.devuan.org; 30 Jun 2025 18:15:06 +0000
Return-Path: <davidpaul@librem.one>
Delivered-To: bugs@devuan.org
Received: from email.devuan.org [2a01:4f9:fff1:13::5fd9:f9e4]
	by doc.devuan.org with IMAP (fetchmail-6.4.16)
	for <debbugs@localhost> (single-drop); Mon, 30 Jun 2025 18:15:05 +0000 (UTC)
Received: from email.devuan.org
	by email.devuan.org with LMTP
	id ceBlNvrTYmi+XAAAmSBk0A
	(envelope-from <davidpaul@librem.one>)
	for <bugs@devuan.org>; Mon, 30 Jun 2025 18:14:18 +0000
Received: by email.devuan.org (Postfix, from userid 109)
	id C3FAE4A8; Mon, 30 Jun 2025 18:14:18 +0000 (UTC)
Authentication-Results: email.devuan.org;
	dkim=pass (2048-bit key; unprotected) header.d=librem.one header.i=@librem.one header.a=rsa-sha256 header.s=smtp header.b=dAdMgxjI;
	dkim-atps=neutral
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on email.devuan.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham
	autolearn_force=no version=3.4.6
Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=138.201.176.93; helo=mx1.librem.one; envelope-from=davidpaul@librem.one; receiver=<UNKNOWN> 
Received: from mx1.librem.one (mx1.librem.one [138.201.176.93])
	by email.devuan.org (Postfix) with ESMTPS id A76C337
	for <submit@bugs.devuan.org>; Mon, 30 Jun 2025 18:14:15 +0000 (UTC)
Received: from smtp.librem.one (unknown [192.241.214.14])
	by mx1.librem.one (Postfix) with ESMTPS id A760381E3F
	for <submit@bugs.devuan.org>; Mon, 30 Jun 2025 11:14:11 -0700 (PDT)
Authentication-Results: name mx1.librem.one; dmarc=fail (p=reject dis=none) header.from=librem.one
Date: Mon, 30 Jun 2025 13:13:55 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=librem.one; s=smtp;
	t=1751307249; bh=cBLWiHw+fMH27tCR8u0ZU6aU7QCizQlLxSNeOhwSdW4=;
	h=Date:From:To:Subject:From;
	b=dAdMgxjIiMEDSAM7aeM9vrXXNbzLwWwCRsfpKb7BHOyQgE+ENOZ47CqDDGgKovFKr
	 E0QRcz3rCCV/k3t1acwqJ4LSDPlND042jHuIq0VacMgoGAqzwNTQ9v4IuFd1tzT+32
	 TgS9aaOrHJz/GqATpjt7EILj3EX1sGJuuh0Gnt4RhV2WH5gPKRxkVFb0SHnvQmNEdb
	 hFmP4//FcXrRcFNaXRsrLm4VikU4iVSAjyPPSp9VLDeOOKBsO/s/2IJaP7BuUrmJO9
	 3QIHBOnPkfoFZuMaMGDosVBPVstTqNs7VDScOpdswS7Q3ZpQ1XAJFdsI23Mlj8OVZ3
	 avt+lgGZLVnhw==
From: "Plasma (David Paul)" <davidpaul@librem.one>
To: Devuan Bug Tracking System <submit@bugs.devuan.org>
Subject: systemctl-service-shim: Breaks automatic grub menu updating
Message-ID: <20250630131355.064829a7@Zombmetheus.egg>
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Control: affects -1 grub2-common
Package: systemctl-service-shim
Version: 0.0.1
Severity: important
X-Debbugs-CC: bgstack15@gmail.com


# 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

Send a report that this bug log contains spam.


Devuan BTS -- Powered by Debian bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.

Devuan Bugs Owner <owner@bugs.devuan.org>.
Last modified: Sun Jul 20 02:44:02 2025;