mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-18 14:56:53 +00:00
CentOS boot script update (#10610)
* centos * Update source/_docs/installation/centos.markdown Fine with me. I did like having the "venv" in there to make it more obvious as to what is going on. Co-Authored-By: Fabian Affolter <mail@fabian-affolter.ch> * Update source/_docs/installation/centos.markdown Co-Authored-By: Fabian Affolter <mail@fabian-affolter.ch>
This commit is contained in:
parent
c5befaf3ed
commit
45bb8c4e2c
@ -52,22 +52,23 @@ You will need to enable the software collection each time you log on before you
|
|||||||
|
|
||||||
### Systemd with Software Collections
|
### Systemd with Software Collections
|
||||||
|
|
||||||
To autostart Home Assistant using systemd follow the main [instructions](/docs/autostart/systemd/) and adjust the template as follows:
|
To autostart Home Assistant using systemd and a python36 (from SCL) virtual environment, follow the main [instructions](/docs/autostart/systemd/) and adjust the template as follows:
|
||||||
|
|
||||||
|
Filename: `/etc/systemd/system/home-assistant@homeassistant.service`
|
||||||
```txt
|
```txt
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Home Assistant
|
Description=Home Assistant
|
||||||
After=network.target
|
After=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=homeassistant
|
# %i means the username is derrived from the filename.
|
||||||
# Make sure the virtualenv Python binary is used
|
User=%i
|
||||||
Environment=VIRTUAL_ENV="/srv/homeassistant"
|
# a python venv for hass exists in /opt/hass/venv
|
||||||
Environment=PATH="$VIRTUAL_ENV/bin:$PATH"
|
ExecStart=/srv/homeassistant/bin/hass
|
||||||
# ExecStart using software collection:
|
|
||||||
ExecStart=/usr/bin/scl enable rh-python36 -- /srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This works because the Python virtual environment was created using the SCL environment, thus there is no need to activate SCL.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user