0

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?

JoSSte
  • 188
  • Don't use sudo reboot, use sudo shutdown -r now to reboot gracefully. – Jos Mar 29 '23 at 07:32
  • isn't sudo reboot just a wrapper for sudo shutdown -r now? – JoSSte Mar 29 '23 at 07:46
  • 1
    Yes, you are right. My bad. However, the service ought to be shut down gracefully then. I can't explain why that doesn't happen. – Jos Mar 29 '23 at 08:09
  • 1
    You'll probably find what you're looking for here: https://askubuntu.com/questions/293312/execute-a-script-upon-logout-reboot-shutdown-in-ubuntu – Terrance Mar 30 '23 at 01:19

0 Answers0