I was running a systemd-nspawn container with command:
systemd-nspawn --console=passive -qbUD container-directory 2>&1 >/dev/null &
to provide a clean build environment. While cleaning up, I forgot to shutdown the container init and instead issued this command on the host console:
sudo rm -rf container-directory
Immediately, I realized that something was wrong because the shell would complain that the directory isn't empty. I tried to shutdown the container with:
sudo machinectl stop container-directory
but noticed that the container won't shut down. In this situation, would there be anything outside of the container that might have been lost? I'm worried that items in /sys or /proc may have been affected if they were mounted via bind mount. There wasn't anything seriously important on the whole system, but I'm wondering if the system may have become unstable due to the effect of this command, such as losing the content of efivars.