-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xen-tools: add
eve-enter-container
script
Once terminal is attached to the Vm console which hosts a container user can execute `eve-enter-container` script and enter corresponding container. Script uses `nsenter -t $pid` and pid is extracted from the /mnt/entrypoint-pid file, created by the chroot2 utility. Signed-off-by: Roman Penyaev <[email protected]>
- Loading branch information
Showing
3 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/bin/busybox | ||
/bin/eve-enter-container | ||
/sbin/agetty | ||
/sbin/mke2fs | ||
/lib/libext2fs.so.2* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
# PID of the started entrypoint container process. | ||
# PID file is created from the `init-initrd` script. | ||
PID_FILE="/mnt/entrypoint-pid" | ||
|
||
if [ ! -f "$PID_FILE" ]; then | ||
echo "Error: PID file '$PID_FILE' not found. Container did not start?" | ||
exit 1 | ||
fi | ||
|
||
PID=$(cat "$PID_FILE") | ||
nsenter -t "$PID" -m -u -i -n -p -r/mnt/rootfs -w/mnt/rootfs |