stage1: remove --pid-file patches from systemd-nspawn

Instead of asking systemd-nspawn to write its "pid" file, rkt can write
the parent pid "ppid". Then, update getPID() to get the pid file from
/proc/$ppid/task/$ppid/children. In this way, we don't need to patch
systemd-nspawn.

getPID() is able to read both the "pid" file and the "ppid" file, in
order to work with alternative stage1s which choose to implement one or
the other method.

coreos/rkt#910
This commit is contained in:
Alban Crequy
2015-06-03 12:58:09 +02:00
parent be40b0eb67
commit 2c25275523
8 changed files with 107 additions and 422 deletions
+2 -1
View File
@@ -52,5 +52,6 @@ for link in ${BUSYBOX_LINKS}; do
done
echo "Busybox installed. Use the following command to enter pod's stage1:"
SYSTEMD_PID=$(sudo cat "${RKT_RUN_DIR}/${UUID}/pid")
SYSTEMD_PPID=$(sudo cat "${RKT_RUN_DIR}/${UUID}/ppid")
SYSTEMD_PID=$(sudo cat /proc/$SYSTEMD_PPID/task/$SYSTEMD_PPID/children)
echo sudo nsenter -m -u -i -p -t ${SYSTEMD_PID}