# the svn box: the service table (PID 1 = /root/planck-init reads THIS file; there is no /etc/inittab).
# The root filesystem is a 9p share of the box's rootfs folder on the host; there is no disk.
# NOTHING RUNS AT BOOT BUT PID 1: every line below is done by planck-init itself (a builtin, or its listen socket), so
# no shell and no busybox start, and after boot the one resident process is PID 1. busybox and dropbear are read from
# the share when somebody connects.
# MOUNT POINTS: the rootfs ships none of PID 1's. planck-init (component devnodes) makes /dev (a ramfs with six nodes:
# the kernel has no devtmpfs) and /proc on the share at every boot; a publish (an exact mirror, made with the VM
# stopped) removes the two empty folders again. There is no /sys (no sysfs in the kernel), no /run (nothing keeps
# runtime state) and no /tmp (svn works in its repository). The one mount point that ships is /home/svn/repos.
# OWNERSHIP ON THE SHARE: nobody here touches it. The share is owned by its PUBLISHER (the user that rsyncs the rootfs
# onto the host and must be able to replace every file), so the box's svn IS that uid and dropbear is built without its
# "authorized_keys must be owned by root or the user" rule (dropbear-builder, PLANCK_TRUST_SHARE_OWNERSHIP). A chown
# here would make the share root-owned and break the next publish.
# The repositories: the second 9p share (qemu -virtfs mount_tag=svn), the one thing this box writes.
::builtin:mount 9p svn /home/svn/repos trans=virtio,version=9p2000.L,msize=262144
::builtin:ipv4

# NO console shell (planck: the smallest thing that does the job). The way in is ssh as root; the serial console only
# shows the log. If the network is down, the box is fixed in its rootfs folder and published again, not on the box.
::shutdown:/root/bin/busybox umount -a -r

# ssh: PID 1 listens on port 22 and starts one dropbear per connection, the connection on its stdin/stdout (-i), its
# log on the serial console. dropbear is STATIC (dropbear-builder), keys only, no syslog; the host key is in
# /root/dropbear. At most 8 connections at once; more wait in the accept queue (planck-listen.c).
# -K 30: an SSH keepalive every 30 s once authenticated, exit after 3 unanswered (~90 s). Without it a client that vanishes
# without a FIN leaves its dropbear+svnserve pair, holding 2-3 MB and an open transaction, until the next restart: nothing
# else on the box notices a dead peer (no SO_KEEPALIVE in planck-listen.c, no /proc/sys/net). Not -I: an idle timeout would
# also kill a live client waiting silently for a long transaction to finalize.
::listen:22 /root/bin/dropbear -i -K 30 -r /root/dropbear/dropbear_ed25519_host_key
