blob: c4cf2e5250b879ee4eeb2f7388628b52a6ca6306 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
[Unit]
Description=Home assistant
Documentation=https://www.home-assistant.io/docs/
Wants=network-online.target
After=network-online.target
StartLimitIntervalSec=0
[Service]
Restart=on-failure
RestartSec=30
User=hass
Group=hass
LogsDirectory=hass
LogsDirectoryMode=0750
StateDirectory=hass
StateDirectoryMode=0750
WorkingDirectory=/var/lib/hass
UMask=0027
Environment=HOME=/var/lib/hass
Environment=PATH=/usr/bin:/var/lib/hass/.venv/bin
ExecStartPre=/usr/bin/bash -c 'if [ -f /var/lib/hass/.venv/ha_version ]; then OLD=$$(< /var/lib/hass/.venv/ha_version); NEW="@VERSION@"; if [ "$${OLD%.*}" != "$${NEW%.*}" ]; then rm -rf /var/lib/hass/.venv; fi; fi'
ExecStartPre=/usr/bin/python -m venv --upgrade /var/lib/hass/.venv
ExecStartPre=/var/lib/hass/.venv/bin/python -m pip install /usr/share/home-assistant/homeassistant-@VERSION@-py3-none-any.whl
ExecStartPre=/usr/bin/bash -c 'echo "@VERSION@" > /var/lib/hass/.venv/ha_version'
ExecStart=/var/lib/hass/.venv/bin/hass \
--config /var/lib/hass/ \
--log-file /var/log/hass/home-assistant.log \
--log-rotate-days 1
RestartForceExitStatus=100
TimeoutSec=15min
AmbientCapabilities=
CapabilityBoundingSet=
NoNewPrivileges=true
LockPersonality=true
PrivateTmp=true
ProtectClock=true
ProtectControlGroups=true
ProtectHostname=true
ProtectKernelLogs=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectSystem=full
RemoveIPC=true
RestrictNamespaces=true
RestrictRealtime=true
RestrictSUIDSGID=true
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallErrorNumber=EPERM
[Install]
WantedBy=multi-user.target
|