Currently, rebooting/upgrading the instance sends a TERM signal to all
running services, waits 1 second and then reboots. Processes that take
longer to cleanly stop can't do so.
Instead, give each service up to 15s to do a clean shutdown. Reboot 15s
after the command is sent, or after all services are stopped, whichever
comes first.
To make it easier to kill entire process tree for a service, create a
per-service process group. Stopping the service can be done by sending a
single signal to the process group.
This allows running “gok run” for prototyping, even for software you have not
included in the currently running gokrazy image.
fixes https://github.com/gokrazy/gokrazy/issues/88
The first update always worked, but a subsequent update would not.
To manually switch an installation to PARTUUID, mount its boot partition and
replace the root= kernel parameter in cmdline.txt, like so:
/tmp/breakglass669384965 # mkdir boot
/tmp/breakglass669384965 # mount /dev/mmcblk0p1 boot
/tmp/breakglass669384965 # cat boot/cmdline.txt
console=ttyAMA0,115200 root=/dev/mmcblk0p2 init=/gokrazy/init elevator=deadline rootwait
/tmp/breakglass669384965 # sed -i 's,root=/dev/mmcblk0p,root=PARTUUID=471cad93-0,g' boot/cmdline.txt
/tmp/breakglass669384965 # cat boot/cmdline.txt
console=ttyAMA0,115200 root=PARTUUID=471cad93-02 init=/gokrazy/init elevator=deadline rootwait
/tmp/breakglass669384965 # umount boot
/tmp/breakglass669384965 # reboot
The PARTUUID= for your installation is printed by gokr-packer:
[…]
2020/05/01 10:05:34 write.go:366: writing MBR (LBAs: vmlinuz=51789, cmdline.txt=119561, PARTUUID=471cad93)
[…]
When calling reboot shortly after /update/*, the kernel should flush its cache,
but if you’re not calling reboot, it would be good to persist the data on disk
nevertheless.
Regular updates hit /boot, /root, then /switch.
bakery only updates /boot, so we need to take care of persisting the active root
partition across /boot updates.