Add-On Startup Question - Supervisor

After an update to docker, I needed to restart hassio. I assumed I could do it by restarting the hassio-supervisor service, but that only brought up the supervisor and homeassistant. Rebooting the machine brought all of the add-ons up as well, which must mean that I am missing something about how the supervisor starts the other docker containers. What’s the best way to start everything after a docker restart?

Hoping for an answer here. I have tried different things and still don’t understand how the add-ons are supposed to get started.

To restart everything, a reboot of the host from the system page in the ui, or from the terminal can be done. Each addon can also be restarted individually through the UI or the console. Reloading the supervisor will not make other addons restart.

When the host system reboots, what script/file controls the startup of the docker add-ons? I assume something has to tell it what to start. I thought that was the job of the supervisor, but since it doesn’t appear to be, where is that controlled. When I mark an add-on as “Start at boot”, where is that written?

1 Like

I am struggling trying to find that out as well. I am trying to configure a hot-spare secondary Home Assistant instance that should remain stopped unless I manually start it (the machine has to stay running so the config files can be synced to the primary instance). But when I start hassio-supervisor systemctl start hassio-supervisor, the “start-at-boot” addons do not start automatically; since I am using MariaDB, homeassistant takes a long time to start with errors on recorder and logbook components… I know I can manually start each addon with ha addons start <slug>, but there should be a way to automatically start “start-at-boot” addons.

Supervisor detects restarts by recording host uptime into config.json. To simulate host restart and let supervisor to start all the staff f.e. after docker restart, I’ve used jq similar to test_env.sh:

docker stop hassio_supervisor
cd <SUPERVISOR-DATA-DIR>
jq -rM 'del(.last_boot)' config.json > config.json.new && chmod --reference=config.json config.json.new && chown --reference=config.json config.json.new && mv config.json.new config.json
# docker restart or supervisor restart 

Beware, config.json is updated on supervisor shutdown, so you need to stop supervisor(or docker) before removing last_boot from config.json

So instead of rebooting the host after a docker update I manually restart the supervisor service and then I have a HA script that restarts all the addons.

  1. stop supervisor (or just do it in step 3)
  2. do what you need like docker update etc.
  3. ensure supervisor is still stopped, or just stop it again and wait for stop to complete
  4. remove last_boot from supervisor’s config.json using jq line above.
  5. start supervisor, and it will work the same as host reboot, it will start all the staff including HA and addons w/ autostart enabled

PS: it’s not a tutorial, just a hack to get what we need to

@cogneato, @voron - So what’s the non-GUI way to disable/enable addon start-at-boot?

I’ve got an addon that now refuses to start, and is killing the entire HA. I don’t see a workaround. :frowning:

Did you try to restart docker on the host machine ( if it’s not a hassio deploy ) ? It should lead to start up of the HA itself w/o any addons.