I guess because the HA runs in a VM if the PI reboots I have to run these commands again to start the HA?
pi@raspberrypi:~ $ sudo -u homeassistant -H -s
homeassistant@raspberrypi:/home/pi $ cd /srv/homeassistant
homeassistant@raspberrypi:/srv/homeassistant $ source bin/activate
(homeassistant) homeassistant@raspberrypi:/srv/homeassistant $ hass
Would I just make a linux script and do like a cron job so this is always running? I woke up this morning and the HA wasn’t running from last night, so I had to manually run it via SSH.
Is there a better way to handle this?
jocnnor
(Jim O'Connor)
November 17, 2020, 5:18am
2
Just create a service to run it, then do “systemctl enable” which means “start this service on boot”.
Newer Linux distributions are trending towards using systemd for managing daemons. Typically, systems based on Fedora, ArchLinux, or Debian (8 or later) use systemd. This includes Ubuntu releases including and after 15.04, CentOS, and Red Hat. If you are unsure if your system is using systemd, you may check with the following command:
ps -p 1 -o comm=
If the preceding command returns the string systemd, continue with the instructions below.
A service file is needed to control Home Assistant …
If they do exist, skip to the end where you just ‘enable’ the service
sudo systemctl enable home-assistant@YOUR_USER
1 Like
Thanks, Turns out I had the core HA version installed. I installed the HA OS version and now everything works automated.