I have a mini pc running Kubernetes (k3s) with homeassistant.
The issue leading to the question
When I do a sudo reboot (forgetting that the home assistant is running) the sqlite database becomes corrupted, presumably because it is writing to it as I am rebooting.
The question
Is there a mechanism to make Ubuntu wait for a service to shut down gracefully, to avoid this in the future?