Need help getting 3.0 to run as a daemon in the background

the other person was using root as user in a root environment.
not really a normal setup.

and it makes quite a difference on which system you are running appdaemon. the deamon option isnt working on windows for example.

but i just tested it myself with 3.0.2 and i get the same result, so it seems that the deamon mode is broken.
i will look into it.

oke did take it up with Andrew and indeed its broken and in the next version that option is taken out.

if you want to use AD as deamon you need to use systemd (but without -p for the moment, because if i remember correct from another topic thats not working at the moment, will be corrected in next release)

1 Like

Yeah I can live with that - as in my installation its a dedicated box - I imagine longer term the daemon option needs to be fixed though and/or the instructions amended to cover the case of systemd launching appdaemon under a virtualenv environment.

longer term will be that the docs need addition i guess.
or that can actually be short term.
i am really bad with systemd (i never use it) so if you know how i am happy to add it to the docs.

You need to create this file (adjust ExecStart) for where your HA is running

$ cat /etc/systemd/system/appdaemon.service 

#
# Service file for systems with systemd to run appdaemon as the homeassistant user.
#

[Unit]
Description=appdaemon for homeassistant
After=network.target

[Service]
Type=simple
User=homeassistant
ExecStart=/home/homeassistant/appdaemon_venv/bin/appdaemon -c /home/homeassistant/.homeassistant
SendSIGKILL=no
Restart=on-abnormal

[Install]
WantedBy=multi-user.target

then run

sudo systemctl  daemon-reload
sudo systemctl start appdaemon.service
sudo systemctl enable appdaemon.service
2 Likes

so for a venv environment actually only the ExecStart line changes.

ill see if i can describe the ections that need to be changed better, because it wouldnt work on my end this way :wink: