techblog

HS-Service

Aug 15th, 2018
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.71 KB | None | 0 0
  1. #Create a new systemd service
  2. sudo nano /etc/systemd/system/home-assistant@homeassistant.service
  3.  
  4. #copy the code below and insert it by right clicking in the SSH prompt
  5. [Unit]
  6. Description=Home Assistant
  7. After=network.target
  8.  
  9. [Service]
  10. Type=simple
  11. User=homeassistant
  12. ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"
  13.  
  14. [Install]
  15. WantedBy=multi-user.target
  16.  
  17.  
  18. #enable the new service
  19. sudo systemctl --system daemon-reload
  20. sudo systemctl enable home-assistant@homeassistant
  21. sudo systemctl start home-assistant@homeassistant
  22.  
  23. #To check status of Home Assistans
  24. sudo systemctl status home-assistant@homeassistant
  25.  
  26. #Reboot your system to see that autostart works
  27. sudo reboot
Advertisement
Add Comment
Please, Sign In to add comment