3 # Script to stop the nominated overlay subhost
5 OVERLAYDIR="$(dirname $(realpath $0))"
6 . $OVERLAYDIR/functions $*
11 read USPID RSPID <<EOF
15 if [ -z "$USPID" ] ; then
16 [ -r /run/netns/$NAME ] && ip netns del $NAME
17 echo "$NAME is not running" >&2
21 if [ -z "$RSPID" ] ; then
23 *** $NAME is started (pid $USPID) but doesn't seem to be running
24 *** /.reaper and might need manual fixing.
29 START="$(reverse "$START")"
30 nsenter -t $RSPID -p -m -i -u \
31 ip netns exec $NAME chroot $(realpath $LIVE) \
32 /bin/sh -c "for srv in $START ; do service \$srv stop ; done"
34 for p in $RSPID $USPID ; do
35 for S in 15 1 2 9 ; do
41 [ -r /run/netns/$NAME ] && ip netns del $NAME