Note: “SW bugs discussion” is a first approximation to a category for this problem. Some other category may turn out to be more appropriate.
After setting up external storage on a USB stick and starting to use this for LXC and pakon, I’m seeing that sometimes the USB stick is not mounted at /srv after a reboot. when this happens, it seems to be necessary to re-seat the USB device before it is again recognized on a subsequent reboot. This has undesired effects for LXC and for pakon.
LXC startup fails, as the relevant configuration and resources in /srv/lxc are missing. This at least prevents unwanted activity on the emmc device.
On the other hand, pakon creates resources in /srv (on the emmc device) so that there are now two copies of its persistent data.
I’ve not been able to establish yet whether the observed problem is specific to certain brands of USB flash, or to flash rather than USB-connected spinning rust, or is due to some race condition, or what.
I think it would be good to have some indication in persistent state (eg: some new file in /etc/config, manipulated by UCI) that external storage had been set up, which would be probed during startup of packages such as LXC or pakon, so that these would avoid starting unless the storage they needed were on some non-root file system.
On reflection, it seems to me that /etc/config/fstab has all the necessary state already, so no new config file would be needed.
Relevant init scripts would simply need to test for an enabled stanza in the fstab config which referred to /srv as the target, and fail if such was found AND /srv was not a mount point.