Detect init system in chroot
This commit is contained in:
parent
51884e215c
commit
7832b17ae1
9
jlmkr.py
9
jlmkr.py
|
@ -1373,11 +1373,12 @@ def create_jail(**kwargs):
|
||||||
# But alpine jails made with jailmaker have other issues
|
# But alpine jails made with jailmaker have other issues
|
||||||
# They don't shutdown cleanly via systemctl and machinectl...
|
# 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 (
|
if (
|
||||||
os.path.basename(
|
init_system_name != "systemd"
|
||||||
os.path.realpath(os.path.join(jail_rootfs_path, "sbin/init"))
|
|
||||||
)
|
|
||||||
!= "systemd"
|
|
||||||
):
|
):
|
||||||
print(
|
print(
|
||||||
dedent(
|
dedent(
|
||||||
|
|
Loading…
Reference in New Issue