summaryrefslogtreecommitdiff
path: root/systemd-hook
diff options
context:
space:
mode:
authorYurii Kolesnykov <root@yurikoles.com>2021-06-06 23:53:52 +0300
committerYurii Kolesnykov <root@yurikoles.com>2021-06-06 23:53:52 +0300
commit612de875ca7996334288d88fff0b3687095924f7 (patch)
treeba0c5aa096ab24025e727b8988def4be847a0c08 /systemd-hook
parentb415dbb33f0a98bd40aab3df8dc6f6805dc28c04 (diff)
downloadsystemd-git-612de875ca7996334288d88fff0b3687095924f7.tar.gz
systemd-git-612de875ca7996334288d88fff0b3687095924f7.tar.bz2
sync with testing/systemd
Signed-off-by: Yurii Kolesnykov <root@yurikoles.com>
Diffstat (limited to 'systemd-hook')
-rw-r--r--systemd-hook9
1 files changed, 9 insertions, 0 deletions
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