summaryrefslogtreecommitdiffstats
path: root/lib/container/enter
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-07-19 06:34:51 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-08-04 13:35:54 +0000
commitd518bcb09d86c1a0d19c23c3997c738470202fad (patch)
tree82df7ce1db79a725eff77648378bcc7a98870acd /lib/container/enter
parentAdding container-nsenter program for container enter command. (diff)
downloadcompute-tools-d518bcb09d86c1a0d19c23c3997c738470202fad.tar.xz
compute-tools-d518bcb09d86c1a0d19c23c3997c738470202fad.zip
Calling container-nsenter program from container enter command.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xlib/container/enter12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/container/enter b/lib/container/enter
index 101b43e..4eff504 100755
--- a/lib/container/enter
+++ b/lib/container/enter
@@ -60,7 +60,7 @@ Parameters ()
Usage ()
{
- echo "Usage: container ${COMMAND} -n|--name NAME [-- COMMAND|\"COMMANDS\"]" >&2
+ echo "Usage: container ${COMMAND} -n|--name NAME" >&2
exit 1
}
@@ -90,7 +90,13 @@ case "${STATE}" in
esac
LEADER="$(machinectl status ${NAME} | awk '/Leader: / { print $2 }')"
-COMMANDS="$(echo ${@} | sed -e 's|.*-- ||')"
# Run
-nsenter --target ${LEADER} --mount --uts --ipc --net --pid --root --wd=/root ${COMMANDS}
+if [ -e "${MACHINES}/${NAME}/usr/bin/container-nsenter" ]
+then
+ OPTIONS="/usr/bin/container-nsenter"
+else
+ OPTIONS=""
+fi
+
+nsenter --target ${LEADER} --mount --uts --ipc --net --pid --root --wd=/root ${OPTIONS}