Hassos - flexibility

@ttmetro The most simplistic way to install Hass.io is this.

  • Install Ubuntu, or like version of Linux. (I use Ubuntu 16.04 LTS on my NUC)
  • sudo apt update && sudo apt dist-upgrade -y && sudo apt autoremove -y

Then follow the instructions from here

sudo -i
apt-get install software-properties-common
add-apt-repository universe
apt-get update
apt-get install -y apparmor-utils apt-transport-https avahi-daemon ca-certificates curl dbus jq network-manager socat
curl -fsSL get.docker.com | sh

curl -sL "https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh" | bash -s

This will install Hass.io to your machine, you can then install any of the native or community Hass.io add-ons from within HA.

Any add-ons you wish to use that aren’t within HA, you would install a Docker container as you did before.

I would also recommend you install Portainer to manage your docker containers.

sudo docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

Once you have this complete, you will manage Hass.io and native add-on updates from within HA itself and manage any external container you have manually installed outside the HA environment, using Portainer.

You will almost never need to update your base operating system, Ubuntu in this case.

EDIT
You can follow this guide
https://drive.google.com/open?id=1oKhnQ1rz-Yd5HheA8rNk5YNq8e67-5Kh

1 Like

No. That’s the docker ce script…but it’s only 4 commands if you just run them yourself. I don’t use those scripts.

No. Don’t rerun the hassio installer script.

Again, your system has everything from the first time you ran the script. It has the systemd scripts, and the paths.

Please go read the hassio script.

Yes! That’s all it does. You don’t need to run the script again because you already have the service in place, and apparmor…just stop the service and delete the docker containers. You don’t need to stop the docker daemon. Just delete the containers and restart the service.

I disagree with that. You should update the base O/S regularly… that’s how you get security updates…

Yes that is exactly what I do here.

Updates and updates - yes install updates, no you won’t need to do a distro update. If you are on LTS you get stability for some years…

1 Like

Yeah for example there was a critical security update for docker recently everyone was getting very excited about.

I was referring to a normal upgrade of course not a dist-upgrade. Personally I do a dist-upgrade normally but I’m running Debian so there’s very little chance of that screwing something over unexpected.

God I wish I could find a rolling distro I really like. I was a gentoo user for years, but I prefer to do stuff with my computer as opposed to minding it like a toddler driving a tank. I may move to arch at some point.

1 Like

Hahaha, love this.

Perhaps this isn’t clear enough. I thought it was.

Do security updates, without the need to do a dist-upgrade, really ever.

I think we are clear now, even those of us who are a bit slower :slight_smile:

1 Like

Lol @ everyone confusing a dist-upgrade with a release upgrade…

sudo apt dist-upgrade is safe.

dist-upgrade
   dist-upgrade in addition to performing the function of upgrade,
   also intelligently handles changing dependencies with new versions
   of packages; apt-get has a "smart" conflict resolution system, and
   it will attempt to upgrade the most important packages at the
   expense of less important ones if necessary. So, dist-upgrade
   command may remove some packages. The /etc/apt/sources.list file
   contains a list of locations from which to retrieve desired package
   files. See also apt_preferences(5) for a mechanism for overriding
   the general settings for individual packages.

Yep it is pretty slow with default settings as HA stores the database on the SD card. Once I moved it to a mySQL database running externally things were much much faster, it was like running HA on a different system, plus no more writing to the SD card for the database.

Things like restarting the HA container still takes a few minutes however, luckily I don’t have to do this very often.

HassOS does limit you with what can be done, this is by design, and allows for easy upgrades but at the expense of the ability to tinker and add and remove packages. If it allowed you to install extra packages, then it would have to keep them up to date also, and can break other things.

HassOS It has no package manager, everything is a HassIO addon instead.

If you are able to do everything you want with HassIO addons, great, however if there isn’t a hassIO addon for some piece of software you need to:

  1. Made your own addon for the software you need.
  2. Move whole system another OS with a package manager like debian/ubuntu/etc.
  3. Use a other system to run that software

I went with option 3 but as you have a single NUC you should probably go with option 2 unless HassIO has the addons you need. :slight_smile:

Did this:

  1. sudo service hassio-supervisor stop
  2. ran docker ps -a and stopped and removed all containers related to homeassistant (docker rm ...)
  3. Restarted sudo service hassio-supervisor start (came up just fine)
  4. As a test, installed the Visual Studio Code add-on. Started and got the following fatal error in the log “13: Permission denied”:
INFO  Started (click the link below to open):
INFO  http://localhost:8443/
INFO   
[10:36:20] INFO: Starting NGinx...
nginx: [emerg] open() "/proc/1/fd/1" failed (13: Permission denied)
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Exactly where I started from …

Check the service. Update filepaths as needed.

/etc/systemd/system$ more hassio-supervisor.service 
[Unit]
Description=Hass.io supervisor
Requires=snap.docker.dockerd.service
After=snap.docker.dockerd.service dbus.socket

[Service]
Type=simple
Restart=always
RestartSec=5s
ExecStartPre=-/snap/bin/docker stop hassio_supervisor
ExecStartPre=-/snap/bin/docker stop hassio_supervisor
ExecStart=/usr/sbin/hassio-supervisor
ExecStop=-/snap/bin/docker stop hassio_supervisor

[Install]
WantedBy=multi-user.target

The “correct” docker is at /usr/bin. So I change snap --> usr in the Exec path.

But what do I do about

Requires=snap.docker.dockerd.service
After=snap.docker.dockerd.service dbus.socket

Can someone tell me what their /etc/systemd/systemd/hassio-supervisor.service file contains?

Thanks!

Just found that /etc/hassio.json also needs updating:

$ more /etc/hassio.json
{
    "supervisor": "homeassistant/amd64-hassio-supervisor",
    "homeassistant": "homeassistant/intel-nuc-homeassistant",
    "data": "/root/snap/docker/common/hassio"
}

Will there be any more? Sometimes it’s easier to reinstall to get it all right …

In case someone cares:

more /etc/systemd/system/hassio-supervisor.service 
[Unit]
Description=Hass.io supervisor
Requires=docker.service
After=docker.service dbus.socket

[Service]
Type=simple
Restart=always
RestartSec=5s
ExecStartPre=-/usr/bin/docker stop hassio_supervisor
ExecStartPre=-/usr/bin/docker stop hassio_supervisor
ExecStart=/usr/sbin/hassio-supervisor
ExecStop=-/usr/bin/docker stop hassio_supervisor

[Install]
WantedBy=multi-user.target

I reran the hassio configuration script but patched as follows:

#detect if running on snapped docker
if false; then # snap list docker >/dev/null 2>&1; then

For some reason the script uses the “snapped docker” if available. It does not even check if /usr/bin/docker exists.

From what I conclude from the above discussion, this is backwards: it should first check for the “official” docker /usr/bin/docker, warn (or, better, just exit) if not, and, possibly give the option to use the “snapped docker” (giving endless headaches).

For good measure I removed the wrong docker from my system:

$ snap list docker
error: no matching snaps installed

@ttmetro Is there any reason you are persisting with the snap install you have?

In the time you have been trying to debug and get this working, you could have easily done a fresh install using the method I posted above 3 times over and be up and running.

Maybe I am missing something?

Yes, do this :slight_smile:

I was following the advice in the thread NOT to reinstall …

I would start fresh using the guide I posted above earlier. That’s just my opinion.

I know those install instructions work as I made a recent edit to those instruction on the website, and have used them myself a number of times to install to a NUC and Pi3.

Completely up to you, you may be only 1 step away from sorting it all out, but honestly, start over. It will take 30mins to be back up and running.