Page 1 of 1

[Answered] home assistant

Posted: Wed Dec 05, 2018 10:39 am
by pakikje
Hello,

I installed Homeasssistant via dietpi-software (runs great). I also updated it several times (v 0.83.1) . I was wondering how homeassistant starts at boot-time/reboot?

In htop i see this: /usr/bin/python3 /usr/local/bin/hass -v -config /opt/homeassistant --pidfile /var/run/hass.pid --daemon

Basically i want to stop/start homeassistant from the command line...

Thnx!

Re: home assistant

Posted: Wed Dec 05, 2018 2:34 pm
by k-plan
Hi,
pakikje wrote: Wed Dec 05, 2018 10:39 am Basically i want to stop/start homeassistant from the command line...
Use dietpi-services

Code: Select all

:~# dietpi-services
[  OK  ] DietPi-Services | Root access verified.

 DietPi-Services
─────────────────────────────────────────────────────
 Mode:

[ INFO ] DietPi-Services | Invalid command
Available options:

 - start/stop/restart/status            (all services, known to DietPi)
 - start/stop/restart <servicename>     (single service, systemd)
 - systemd_controlled/dietpi_controlled (all services, known to DietPi)
 - enable/disable all                   (all services, known to DietPi)
 - enable/disable <servicename>         (single service, systemd)
 - mask/unmask all                      (all services, known to DietPi)
 - mask/unmask <servicename>            (single service, systemd)

 - You can include/exclude custom services by editing the following file: /DietPi/dietpi/.dietpi-services_include_exclude

Code: Select all

:~# dietpi-services status

Code: Select all

:~# dietpi-services stop home-assistant

Re: home assistant

Posted: Thu Dec 06, 2018 12:09 pm
by pakikje
thnx man!

Re: home assistant

Posted: Fri Dec 07, 2018 2:44 am
by MichaIng
Jep, it's basically a systemd service, so systemctl start|stop|restart home-assistant can be used.
dietpi-services start|stop|restart <service_name> is our error handled front-end for this.

The services are started at the end of boot stage from: /DietPi/dietpi/postboot
Sadly you cannot natively disable/mask it, since it is already located at /etc/systemd/system/home-assistant.service, where masking would create a symlink to /dev/null usually to prevent the service from being started.
However you could move it to /lib/systemd/system/home-assistant.service, the place which is used by APT packages:
mv /etc/systemd/system/home-assistant.service /lib/systemd/system/home-assistant.service
Then use:
systemctl mask home-assistant or
dietpi-services mask home-assistant