Source: insserv
Version: 1.26.0-1
Severity: wishlist
X-Debbugs-Cc: [email protected]
User: [email protected]
Usertags: hurd-amd64 hurd-i386

Hi,

my goal is to easily create chroots for Debian GNU/Hurd on systems running the
default Debian init system: systemd. Since Hurd binaries cannot be executed on
Linux, dpkg --force-script-chrootless is used and this requires insserv to be
installed outside of the chroot. This is not possible if the system on the
outside has systemd installed because that conflicts with insserv and according
to Michael Biebl this is not going to change. A possible way forward would be
if another binary package could be produced by src:insserv which just ships the
insserv binary in a location that is not in $PATH.

I opened https://salsa.debian.org/debian/insserv/-/merge_requests/2 with a
possible way forward. From the MR description:

The systemd-sysv package conflicts with insserv (see #1072562 for details) and
in #debian-devel Michael Biebl confirmed that this is not likely going to
change. But systemd does not work on non-Linux systems like GNU/Hurd, so when
creating chroots for these systems, sysvinit is usually used instead. Since
Hurd binaries cannot be executed on Linux, the chroot is created using dpkg
--force-script-chrootless which executes maintainer scripts without chroot
isolation and uses the $DPKG_ROOT environment variable to communicate the
location of the chroot directory. To install packages shipping sysvinit scripts
(like openssh-server) the insserv utility has to be run but due to systemd-sysv
conflicting with insserv, the system on the outside must not have systemd-sysv
installed. This means that to create a Hurd chroot, another chroot layer around
it is needed. It would be convenient if that additional layer could be avoided
when creating chroots for GNU/Hurd and other operating systems which use
insserv on systems which boot with systemd.

Michael Biebl suggested that one possible way forward would be to add a
insserv-bin package which ships a copy of /usr/sbin/insserv but places it
outside of $PATH as /usr/libexec/insserv. The systemd-sysv would then not need
to Conflict with that package.

To keep this change minimally invasive, the insserv-bin ships a copy of the
insserv binary which is also shipped in the insserv package. In fact, this
patch does not change the insserv binary package at all (it remains bit-by-bit
identical to how it looked like before this change).

Alternatively, the insserv binary package could be changed to gain a Depends on
insserv-bin and ship a symlink from /usr/sbin/insserv to /usr/libexec/insserv.

What do you think?

Thanks!

cheers, josch

>From 7de38d8d9cb8985fc300668fe64a6d0568ee1791 Mon Sep 17 00:00:00 2001
From: Johannes Schauer Marin Rodrigues <[email protected]>
Date: Fri, 13 Mar 2026 18:18:40 +0100
Subject: [PATCH] Add insserv-bin binary package with /usr/libexec/insserv

The systemd-sysv package conflicts with insserv (see #1072562 for
details) and in #debian-devel Michael Biebl confirmed that this is not
likely going to change. But systemd does not work on non-Linux systems
like GNU/Hurd, so when creating chroots for these systems, sysvinit is
usually used instead. Since Hurd binaries cannot be executed on Linux,
the chroot is created using dpkg --force-script-chrootless which
executes maintainer scripts without chroot isolation and uses the
$DPKG_ROOT environment variable to communicate the location of the
chroot directory. To install packages shipping sysvinit scripts (like
openssh-server) the insserv utility has to be run but due to
systemd-sysv conflicting with insserv, the system on the outside must
*not* have systemd-sysv installed. This means that to create a Hurd
chroot, another chroot layer around it is needed. It would be convenient
if that additional layer could be avoided when creating chroots for
GNU/Hurd and other operating systems which use insserv on systems which
boot with systemd.

Michael Biebl suggested that one possible way forward would be to add a
insserv-bin package which ships a copy of /usr/sbin/insserv but places
it outside of $PATH as /usr/libexec/insserv. The systemd-sysv would then
not need to Conflict with that package.

To keep this change minimally invasive, the insserv-bin ships a copy of
the insserv binary which is also shipped in the insserv package. In
fact, this patch does not change the insserv binary package at all (it
remains bit-by-bit identical to how it looked like before this change).

Alternatively, the insserv binary package could be changed to gain a
Depends on insserv-bin and ship a symlink from /usr/sbin/insserv to
/usr/libexec/insserv.
---
 debian/control                        | 18 ++++++++++++++++++
 debian/insserv-bin.install            |  1 +
 debian/{dirs => insserv.dirs}         |  0
 debian/{docs => insserv.docs}         |  0
 debian/{install => insserv.install}   |  3 +++
 debian/{postinst => insserv.postinst} |  0
 debian/{postrm => insserv.postrm}     |  0
 7 files changed, 22 insertions(+)
 create mode 100644 debian/insserv-bin.install
 rename debian/{dirs => insserv.dirs} (100%)
 rename debian/{docs => insserv.docs} (100%)
 rename debian/{install => insserv.install} (73%)
 rename debian/{postinst => insserv.postinst} (100%)
 rename debian/{postrm => insserv.postrm} (100%)

diff --git a/debian/control b/debian/control
index 93b011f..38c2ffe 100644
--- a/debian/control
+++ b/debian/control
@@ -30,3 +30,21 @@ Description: boot sequence organizer using LSB init.d script 
dependency informat
  detecting and rejecting dependency loops.
  .
  Using insserv incorrectly can result in an unbootable system.
+
+Package: insserv-bin
+Architecture: any
+Depends:
+ ${misc:Depends},
+ ${shlibs:Depends},
+Description: boot sequence organizer using LSB init.d script dependency 
information (binary only)
+ The insserv program is used by the standard SysV-based init system. It
+ updates the order of symlinks in /etc/rc?.d/ based on dependencies
+ specified by LSB headers in the init.d scripts themselves.
+ .
+ These declared relations between scripts make it possible to optimize
+ the boot sequence for the currently installed set of packages, while
+ detecting and rejecting dependency loops.
+ .
+ This package ships the insserv binary from the insserv package but it places
+ the executable into /usr/libexec/insserv so that it does not appear in the
+ system's $PATH and can safely be installed alongside systemd-sysv.
diff --git a/debian/insserv-bin.install b/debian/insserv-bin.install
new file mode 100644
index 0000000..5edb2f8
--- /dev/null
+++ b/debian/insserv-bin.install
@@ -0,0 +1 @@
+usr/sbin/insserv /usr/libexec
diff --git a/debian/dirs b/debian/insserv.dirs
similarity index 100%
rename from debian/dirs
rename to debian/insserv.dirs
diff --git a/debian/docs b/debian/insserv.docs
similarity index 100%
rename from debian/docs
rename to debian/insserv.docs
diff --git a/debian/install b/debian/insserv.install
similarity index 73%
rename from debian/install
rename to debian/insserv.install
index c46ba93..9ebab33 100644
--- a/debian/install
+++ b/debian/insserv.install
@@ -2,3 +2,6 @@ debian/check-archive-initd-scripts usr/share/insserv
 debian/check-initd-order usr/share/insserv
 debian/make-testsuite usr/share/insserv
 debian/seq-changes usr/share/insserv
+usr/sbin/insserv
+etc/insserv.conf
+usr/share/man/man8/insserv.8
diff --git a/debian/postinst b/debian/insserv.postinst
similarity index 100%
rename from debian/postinst
rename to debian/insserv.postinst
diff --git a/debian/postrm b/debian/insserv.postrm
similarity index 100%
rename from debian/postrm
rename to debian/insserv.postrm
-- 

Reply via email to