@stuartl hah, I found something.

$ sudo sh -c 'test /proc/1/root -ef /proc/$$/root && echo ja || echo nein'

This indicates whether init and the current process tree are in the same root. And sudo readlink -e /proc/1/exe exits false if it doesn’t exist, either. So, a combination.

Replacing if [ -d /run/systemd ]; then with if readlink -e /proc/1/exe >/dev/null 2>&1 && test /proc/1/root -ef /proc/$$/root; then in the affected maintainer scrips will do.

Unfortunately, this would first need to be added to #debhelper, then trickle down all the way into #bookworm (#Debian oldstable at this point), and then all affected packages would need to be rebuilt within oldstable so their maintainer scripts get regenerated with the fixed snippets. (Also third-party packages, but there are none at this point.)

Fat chance, that.</sarcasm>

So.

We have policy-rc.d in #Debian.

Yet, #debhelper-added scriptlets in maintainer scripts call systemctl if [ -d /run/systemd ].

Which is bad if you’re in an #schroot with /run bind-mounted from the host and the host is running systemd (a customer system, none of mine).

What I need is a way to #whiteout a directory from a #bind #mount.

I heard #overlayfs can do that, but it seems to no longer exist.

Any other ideas¹?

(And yes, I want and need to bind-mount /run itself, as the #chroot adds sockets there that are then accessed from outside the chroot, viceque versa.)

① customer-compatible ones, please; switching the host system to sysvinit is one but the customer’s Ansible standardised on managing all systems with systemd…

Glancing at a postinst script before implementing a new feature via preinst/postinst cooperation:

– Huh, that `##DEBHELPER##` really should be `#DEBHELPER#`, shouldn't it? How does this even work?!

(It's been 4 years, we would have noticed if it didn't?!)

@katzenmann I doubt there's a technical reason for #debhelper not being in #NixPkgs. Probably there just hasn't been much demand for it being in NixPkgs, yet: The only NixPkgs issue mentioning it is https://github.com/NixOS/nixpkgs/issues/30926 and there people seem to have found some solution without it.

If it's important to you, maybe try to add it to NixPkgs? The step from maintaining a NixOS installation to packaging (well-behaved) stuff for NixPkgs isn't as big as in other distros.

Trying to package Manager.io · Issue #30926 · NixOS/nixpkgs

I'm trying to package Manager which is built ontop of Mono. They are now distributing versioned debian archives. It's debian information is: [nix-shell:~/Projects/manager]$ dpkg -I ./Manager.deb ne...

GitHub
@warthog9 I’m technically not a #debian maintainer, nor do I do the snake language, but #debhelper works for me, especially if there’s only one binary package in debian/control, debian/rules is the barebones %: dh $@ version, and the software has a makefile whose install target puts stuff under $DESTDIR/.

There are quite a few #debian tools included in #Fedora . Not just #debhelper: also #devscripts.

But eventually it turned out that this was not enough. Some things (specifically: python2 and python3 debhelper sequences) were missing. So we turned to install Debian in a (s)chroot.

... ->