From: Ralph Ronnquist Date: Mon, 21 Mar 2022 03:30:15 +0000 (+1100) Subject: reworked and fixed X-Git-Tag: deb_0.1~23 X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=11bddd4fbe1567ca6571a520752a2478efcec1a3;p=rrq%2Foverlay-boot.git reworked and fixed --- diff --git a/overlay-go b/overlay-go index dd557d8..d22ef35 100755 --- a/overlay-go +++ b/overlay-go @@ -1,8 +1,22 @@ #!/bin/sh -set -x -X="$(pgrep -f ".reaper $1")" -grep -q "^proc " /proc/$X/mounts || \ - sudo nsenter -t "$X" -m -p -r -w mount -t proc proc /proc -ROOT="$(sudo nsenter -t "$X" -m -p -r -w mount | \ - awk -v S="$1" '$1==S{print $3;exit;}')" -sudo nsenter -t "$X" -n -m -p -r -w -u -C /bin/bash + +[ $(id -u) = 0 ] || exec sudo $0 $@ +. $(dirname $(realpath $0))/functions XXX + +NAME="$1" + +read USPID RSPID <&2 && exit 1 + +if [ -z "$RSPID" ] ; then + cat <&2 +*** $NAME is started (pid $USPID) but doesn't seem to be running +*** /.reaper and might need manual fixing. +EOF + exit 1 +fi + +sudo nsenter -t "$RSPID" -n -m -p -r -w -u -C /bin/bash