I’ve got Home Assistant up and running on my Raspberry Pi 2 using the manual installation method (https://home-assistant.io/docs/installation/raspberry-pi/), but I cannot get any of the autostart-versions to work, since the instructions are not written for the Virtual Environment-installation.
Does anyone know how to get this working with init.d?
You should be using systemd on a raspberry Pi 2. Create this file as root user
(remove influxdb and mosquitto if you don’t use them)
pi@raspberrypi:/home/homeassistant/.homeassistant
$ cat /etc/systemd/system/[email protected]
# This is a simple service file for systems with systemd to tun HA as user.
#
# For details please check https://home-assistant.io/getting-started/autostart/
#
[Unit]
Description=Home Assistant for %i
After=network.target mosquitto.service influxdb.service
[Service]
Type=simple
User=%i
ExecStart=/srv/homeassistant/bin/hass
SendSIGKILL=no
Restart=on-failure
[Install]
WantedBy=multi-user.target
Actually, the instruction for systemd are available on the wiki. You should probably use those, as they seem to have extra lines about the virtualenv (in the final example).
Mine was installed with hassbian a few months ago, and has obviously become out of date. Although I’m not going to change it while it works.
Your systemd file seems to be specifying that hass is at /usr/bin/hass. This is the first set of instructions on the systemd page.
You need to follow the instructions after the section that says
If you’ve setup Home Assistant in virtualenv following our python installation guide or manual installation guide for raspberry pi, the following template should work for you.