summaryrefslogtreecommitdiffstats
path: root/lib/container/enter
diff options
context:
space:
mode:
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}"