From 612de875ca7996334288d88fff0b3687095924f7 Mon Sep 17 00:00:00 2001 From: Yurii Kolesnykov Date: Sun, 6 Jun 2021 23:53:52 +0300 Subject: sync with testing/systemd Signed-off-by: Yurii Kolesnykov --- systemd-hook | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'systemd-hook') diff --git a/systemd-hook b/systemd-hook index 6f2e899..0a4754b 100644 --- a/systemd-hook +++ b/systemd-hook @@ -1,6 +1,14 @@ #!/bin/sh -e +is_chrooted() { + if systemd-detect-virt --chroot; then + echo >&2 " Skipped: Running in chroot." + exit 0 + fi +} + systemd_live() { + is_chrooted if [ ! -d /run/systemd/system ]; then echo >&2 " Skipped: Current root is not booted." exit 0 @@ -8,6 +16,7 @@ systemd_live() { } udevd_live() { + is_chrooted if [ ! -d /run/udev ]; then echo >&2 " Skipped: Device manager is not running." exit 0 -- cgit v1.2.3-70-g09d2