From 7832b17ae193a39d61baa13b79cfffeed0cbdc21 Mon Sep 17 00:00:00 2001 From: Jip-Hop <2871973+Jip-Hop@users.noreply.github.com> Date: Mon, 24 Jun 2024 10:24:33 +0200 Subject: [PATCH] Detect init system in chroot --- jlmkr.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jlmkr.py b/jlmkr.py index 4525dd2..9f6faee 100755 --- a/jlmkr.py +++ b/jlmkr.py @@ -1373,11 +1373,12 @@ def create_jail(**kwargs): # But alpine jails made with jailmaker have other issues # They don't shutdown cleanly via systemctl and machinectl... + enter_chroot(jail_rootfs_path) + init_system_name = os.path.basename(os.path.realpath("/sbin/init")) + exit_chroot() + if ( - os.path.basename( - os.path.realpath(os.path.join(jail_rootfs_path, "sbin/init")) - ) - != "systemd" + init_system_name != "systemd" ): print( dedent(