3 # This is a script to run at startup of a bespoke sub-host
5 date +"subhost startup at %Y%m%d-%H%M%S"
7 mkdir -p /dev/pts /dev/shm /run
8 [ -f /proc/mounts ] || mount -t proc proc /proc
9 if ! grep "^none /run tmpfs" /proc/mounts ; then
10 mount -t tmpfs -osize=80M none /run
11 mount -t tmpfs -osize=20M none /dev/shm
12 mount -t devpts none /dev/pts
13 mount -t sysfs none /sys
14 mkdir -p /run/lock /run/user
17 if grep -q ' / ext4 rw,' /proc/mounts ; then
19 ## Here's the "pretend init"
24 true # echo "zombie return $?" >&2
26 trap "zombie" 17 # SIGCHILD
28 /etc/init.d/rc S < /dev/null
29 /etc/init.d/rc 2 < /dev/null
30 SUBHOSTCTL=/run/initctl
32 exec cat < $SUBHOSTCTL
35 echo "** The root filesystem is read-only; EXITING" >&2