Hello there!
I have 2 Home Assistant installations set up in Docker in different locations (different HA versions and different hardware). In both of them I’ve noticed that after a long time without a restart, Home Assistant tends to freeze when trying to restart it from the UI. Home Assistant freezes and has to be restarted manually from Docker software (QNAP). After restarting manually the next restart works correctly, but only for a while, because after a few days it stops working again. How can I force a restart from the automations? I checked service Reload, but it works just like hitting a restart i UI - it freezes and nothing happens…
I have checked the logs after restart, and it doesnt show like there were any problems…
Use command line integration to restart host.
You need ON to be reboot with some delay
OFF will be nothing
I don’t think it will turn OFF so likely you need to manually do this or have automation that does this by default. Potentially this could be part of ON command, to call HA API to turn OFF switch.
Could you have weird db issue?
Do you have ability to monitor startup? I use portainer for this.
Thanks! Restarting docker itself seems to be what I’m looking for… I’ve made some tests and I think it really forces HA to restart without freezing…
I’ve also got an automation that detects the right moment to restart, so so far so good…
Now I do need to make to run a SSH script (on host) from automation… I’ve tried AlexxIT/SSHCommand integration , but somehow I cant execute ‘docker’ command despite login as an admin…
Edit 2:
I’m getting an error, which looks like the docker command can’t be found using command_line…?
/bin/sh: docker: not found
Edit 3:
One step closer… The ‘docker’ pachage is installed in:
/share/CACHEDEV1_DATA/.qpkg/container-station/bin
I’ve noticed that path to “docker” is not defined when trying to execute command from HA: