3 # Script to stop the nominated overlay subhost
5 [ $(id -u) = 0 ] || exec sudo $0 $@
6 . $(dirname $(realpath $0))/functions XXX
10 [ -z "$NAME" ] && echo "Select subhost: $(list_running)" && exit 0
12 read USPID RSPID <<EOF
16 [ -z "$USPID" ] && echo "$NAME is snot running" >&2 && exit 1
18 if [ -z "$RSPID" ] ; then
20 *** $NAME is started (pid $USPID) but doesn't seem to be running
21 *** /.reaper and might need manual fixing.
26 CHILDPIDS="$(nsenter -t $RSPID -p -m ps -hopid --ppid 1)"
27 nsenter -t $RSPID -p -m kill $CHILDPIDS