summaryrefslogtreecommitdiffstats
path: root/lib/container/enter
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-05-27 18:57:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-05-27 18:57:08 +0000
commit34f9dde6d7bc82cef01eb7b3ab001f3e058782f2 (patch)
treebebd390e420aa1556459c192836e271417411273 /lib/container/enter
parentAdding upstream version 20180503. (diff)
downloadopen-infrastructure-compute-tools-34f9dde6d7bc82cef01eb7b3ab001f3e058782f2.tar.xz
open-infrastructure-compute-tools-34f9dde6d7bc82cef01eb7b3ab001f3e058782f2.zip
Adding upstream version 20180527.upstream/20180527
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/container/enter')
-rwxr-xr-xlib/container/enter15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/container/enter b/lib/container/enter
index faf5d35..72b3b1c 100755
--- a/lib/container/enter
+++ b/lib/container/enter
@@ -103,15 +103,16 @@ do
fi
done
+SSH_CLIENT="${SSH_CLIENT:-127.0.0.1 0 0}"
+
# Run
-if [ -e "${MACHINES}/${NAME}/usr/bin/container-nsenter" ]
-then
- OPTIONS="/usr/bin/container-nsenter"
-else
- OPTIONS=""
-fi
+nsenter --all --target "${LEADER}" --wd="${MACHINES}/${NAME}/root" /usr/bin/script -c "/bin/bash -l" -q /dev/null
-nsenter --target ${LEADER} --mount --uts --ipc --net --pid --root --wd=/root ${OPTIONS}
+case "${SSH_CLIENT}" in
+ 127.0.0.1*)
+ unset SSH_CLIENT
+ ;;
+esac
# Post hooks
for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NAME}.post-${COMMAND}"