We have a daemon (called apiservice-kicker) that sleeps for a few seconds and when it wakes up it checks if the apiserver needs to be restarted. Our user reported that at some point the apiservice-kicker daemon could not find the sleep binary inside under $SNAP/bin/. I checked that in revision 743 of MicroK8s the sleep binary is in the right location. Why would this happen? Under what circumstances this may happen?
these questions about dynamic libraries are because “no such file or directory” is also the error you get when trying to run a dynamically linked executable when the executable exists but the libraries it’s trying to load do not.
I think this kind of proves my theory, just that it was not /bin/sleep in your microk8s snap being updated but /bin/bash from the core snap while your script was sleeping for 3 seconds.
I assume the first error occured when the old link went away … a gross hack (but working around the issue) would be to ship bash in the application snap and mangle all hasbang lines in the scripts (perhaps a layout would also work) … but this is indeed rather awful.