From b9ae99b1063a68b568a83ad77c21cb0dd4fa2437 Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Sat, 28 Nov 2020 11:59:19 +0100 Subject: [PATCH] added check --- jaildk | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/jaildk b/jaildk index c260eec..d337cfb 100644 --- a/jaildk +++ b/jaildk @@ -133,15 +133,19 @@ jaildk_rc_rcoff() { # not required in run mode case $mode in start) - if ! test -d $j/etc/rcoff; then - # in order to be backwards compatible to older jaildk - # create the rcoff directory on the fly - mkdir -d $j/etc/rcoff - ( echo "#!/bin/sh" - echo 'echo "$0 disabled in build chroot!"' ) > $j/etc/rcoff/rc - fi + if mount | egrep -q "rcoff.*build/$jail"; then + bold "union mount $j/build/jail/etc already mounted" + else + if ! test -d $j/etc/rcoff; then + # in order to be backwards compatible to older jaildk + # create the rcoff directory on the fly + mkdir -d $j/etc/rcoff + ( echo "#!/bin/sh" + echo 'echo "$0 disabled in build chroot!"' ) > $j/etc/rcoff/rc + fi - ex mount -t unionfs $j/etc/rcoff $j/build/$jail/etc + ex mount -t unionfs $j/etc/rcoff $j/build/$jail/etc + fi ;; stop) # might fail if executed on a yet not union'ed etc