diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2016-08-04 13:45:49 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2016-08-04 13:50:13 +0000 |
commit | e1ac8c36854fbeb60a53a5090fbb673b2a7b9d09 (patch) | |
tree | cc969c8a612fe7412f9d14759e6dc64c77b2a5a1 /lib/container/enter | |
parent | Releasing debian version 20160701-1. (diff) | |
download | open-infrastructure-compute-tools-e1ac8c36854fbeb60a53a5090fbb673b2a7b9d09.tar.xz open-infrastructure-compute-tools-e1ac8c36854fbeb60a53a5090fbb673b2a7b9d09.zip |
Merging upstream version 20160801.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'lib/container/enter')
-rwxr-xr-x | lib/container/enter | 12 |
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} |