Ryan Kraus 7ba2a55232 Updated Advanced Install page to focus on daemon managers.
The advanced install page was reworded to be organized by daemon
manager rather than Linux distribution.

Some wording changes were made on the Getting Started page.
2015-09-05 05:40:45 -04:00

3.9 KiB

layout, title, description, date, sidebar, comments, sharing, footer
layout title description date sidebar comments sharing footer
page Advanced Installation Brief advanced installation tutorials. 2015-9-1 22:57 false false true true

Here are some general tutorials on how to setup some of the more advanced deployments that are frequently requested.

Many linux distributions use the Upstart system (or similar) for managing daemons. Typically, systems based on Debian 7 or previous use Upstart. This includes Ubuntu releases before 15.04 and all current Raspian releases. If you are unsure if your system is using Upstart, you may check with the following command:
ps -p 1 -o comm=

If the preceding command returns the string init, you are likely using Upstart.

Upstart will launch init scripts that are located in the directory /etc/init.d/. A sample init script for systems using Upstart is maintained by this project.

To install this script, download it, tweak it to you liking, and install it by following the directions in the header. This script will setup Home Assistant to run when the system boots. To start/stop Home Assistant manually, issue the following commands:

sudo service hass-daemon start
sudo service hass-daemon stop

When running Home Assistant with this script, the configuration directory will be located at /var/opt/homeassistant. This directory will contain a verbose log rather than simply an error log.

When running daemons, it is good practice to have the daemon run under its own user name rather than the default user's name. Instructions for setting this up are outside the scope of this document.

Newer linux distributions are trending towards using systemd for managing daemons. Typically, systems based on Fedora 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, you are likely using systemd.

If you want Home Assistant to be launched automatically, an extra step is needed to setup systemd. You need a service file to control Home Assistant with systemd.

su -c 'cat <<EOF >> /lib/systemd/system/home-assistant.service
[Unit]
Description=Home Assistant
After=network.target

[Service]
Type=simple
ExecStart=hass

[Install]
WantedBy=multi-user.target
EOF'

You need to reload systemd to make the daemon aware of the new configuration. Enable and launch Home Assistant after that.

sudo systemctl --system daemon-reload
sudo systemctl enable home-assistant
sudo systemctl start home-assistant

If everything went well, sudo systemctl start home-assistant should give you a positive feedback.

$ sudo systemctl status home-assistant -l
● home-assistant.service - Home Assistant
   Loaded: loaded (/usr/lib/systemd/system/home-assistant.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2015-06-25 23:38:37 CEST; 3min 13s ago
 Main PID: 8557 (python3.4)
   CGroup: /system.slice/home-assistant.service
           └─8557 /usr/bin/python3.4 -m homeassistant
[...]

To get Home Assistant's logging output, simple use journalctl.

sudo journalctl -f -u home-assistant

###« Back to Getting Started