pre-packaging fixes
[rrq/overlay-boot.git] / overlay-boot
index f068b43b06fa4ac32168551c331a6974e551b139..431263da2474e30bcd370d270aa820269f5b1393 100755 (executable)
@@ -16,7 +16,10 @@ if [ -z "$UNSHARED" ] ; then
     #
     # Create the network namespace for the subhost, then trigger
     # detached re-run with unshared mount namespace
-    [ -r /run/netns/$NAME ] || ip netns add $NAME
+    [ -r /run/netns/$NAME ] || {
+       ip netns add $NAME
+       ip netns exec $NAME ip link set lo up
+    }
     exec env UNSHARED=yes unshare -m $0 $@ > $LOG 2>&1 &
     echo "Logging to $LOG" >&2
     exit 0
@@ -32,7 +35,6 @@ config LOWER "/"
 config CABLES ""
 config START "networking ssh"
 config SUBSHELL /bin/sh
-config STOP ""
 
 # Setup virtual cabling and subhost's /etc/network/interfaces
 setup_veth_cables $NAME $CABLES
@@ -53,6 +55,8 @@ echo "$CMD"
 cat <<EOF | $CMD
 set -x
 mount -t proc proc /proc
+mount -t devpts devpts /dev/pts
+mount -t sysfs sysfs /sys
 for srv in $START ; do service \$srv start ; done
 exec /.reaper $NAME
 EOF