You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I changed the init scripts to be more reliable.
hass executable supports the option --log-file. Using this is much safer and does not lead to problems with permission and overwriting old logfiles. Also I added creating the directory and ownership in the install function. To prevent log file groth I added a logrotate rule.
I moved the update-rc.d command you had in your manual into the install function since you already ad it in the uninstall function. This prevents more copy&paste errors.
I changed the PID file to be located in an extra directory. This way you do not have to to this hack with writing a fake PID file in the install function. Also, I read many users having problems that hass daemon is not starting (see eg. https://community.home-assistant.io/t/autostart-virtualenv-ubuntu-14-04/2120/37) without showing any errors. This is due to a missing PID file or its wrong permissions. By changing as stated and adding a test this problem should not arise any more.
I changes some wording in the manual to make it more understandable.
Create or pick a user that the Home Assistant daemon will run under. Update script to set `RUN_AS` to the username that should be used to execute hass.
28
28
29
-
### {% linkable_title 3. Change hass executable if required. %}
29
+
### {% linkable_title 3. Change hass executable and other variables if required. %}
30
30
31
-
Some installation environments may require a change in the Home Assistant executable `hass`. Update script to set `HASS_BIN` to the appropriate `hass` executable path.
31
+
Some installation environments may require a change in the Home Assistant executable `hass`. Update script to set `HASS_BIN` to the appropriate `hass` executable path. Please also check the other variables for the appropriate value. In general the defaults should work
32
32
33
-
### {% linkable_title 4. Register the daemon with Linux %}
33
+
### {% linkable_title 4. Install this service %}
34
34
35
35
```bash
36
-
$ sudo update-rc.d hass-daemon defaults
36
+
$ sudo service hass-daemon install
37
37
```
38
38
39
-
### {% linkable_title 5. Install this service %}
39
+
### {% linkable_title 5. Create logrotate rule %}
40
+
41
+
This logrotate script at `/etc/logrotate.d/homeassistant` will create an outage of a few seconds every week at night. If you do not want this add `--log-rotate-days 7` to the `FLAGS` variable in the init script.
42
+
43
+
```
44
+
/var/log/homeassistant/home-assistant.log
45
+
{
46
+
rotate 7
47
+
daily
48
+
missingok
49
+
notifempty
50
+
delaycompress
51
+
compress
52
+
postrotate
53
+
invoke-rc.d hass-daemon restart > /dev/null
54
+
endscript
55
+
}
40
56
41
-
```bash
42
-
$ sudo service hass-daemon install
43
57
```
44
58
45
59
### {% linkable_title 6. Restart Machine %}
46
60
47
61
That's it. Restart your machine and Home Assistant should start automatically.
48
62
49
-
If HA does not start, check the log file output for errors at `/var/opt/homeassistant/home-assistant.log`
63
+
If HA does not start, check the log file output for errors at `/var/log/homeassistant/home-assistant.log`
50
64
51
65
### {% linkable_title Extra: Running commands before hass executes %}
0 commit comments