Appdaemon Install Issue

pip

[Unit]
Description=AppDaemon
[email protected]
[Service]
Type=simple
User=homeassistant
ExecStart=/usr/local/bin/appdaemon -c /home/homeassistant/.homeassistant/conf/
[Install]
WantedBy=multi-user.target

journalctl output

Jan 15 23:16:47 ReinasServer systemd[1]: Stopped appdaemon.
Jan 15 23:16:47 ReinasServer systemd[1]: appdaemon.service: Start request repeated too 
Jan 15 23:16:47 ReinasServer systemd[1]: Failed to start appdaemon.
Jan 15 23:16:47 ReinasServer systemd[1]: appdaemon.service: Unit entered failed state.
Jan 15 23:16:47 ReinasServer systemd[1]: appdaemon.service: Failed with result 'exit-code'.

systemd propertioes

-rwxrwxrwx  1 root root  218 Jan 15 23:15 [email protected]
drwxr-xr-x  2 root root 4096 Dec 29  2017 bluetooth.target.wants
lrwxrwxrwx  1 root root    9 Jan 27  2018 brltty.service -> /dev/null
lrwxrwxrwx  1 root root   37 Dec 29  2017 dbus-org.bluez.service -> /lib/systemd/system/bluetooth.service
lrwxrwxrwx  1 root root   40 Dec 29  2017 dbus-org.freedesktop.Avahi.service -> /lib/systemd/system/avahi-daemon.service
lrwxrwxrwx  1 root root   40 Dec 29  2017 dbus-org.freedesktop.ModemManager1.service -> /lib/systemd/system/ModemManager.service
lrwxrwxrwx  1 root root   53 Dec 29  2017 dbus-org.freedesktop.nm-dispatcher.service -> /lib/systemd/system/NetworkManager-dispatcher.service
lrwxrwxrwx  1 root root   32 Dec  8 23:26 display-manager.service -> /lib/systemd/system/lxdm.service
lrwxrwxrwx  1 root root    9 Nov  9 12:39 epmd.service -> /dev/null
lrwxrwxrwx  1 root root    9 Nov  9 12:39 epmd.socket -> /dev/null

service file

[Unit]
Description=AppDaemon
[email protected]
[Service]
    Type=simple
    User=root
    ExecStart=/usr/local/bin/appdaemon -c /home/homeassistant/.homeassistant/conf/
    [Install]
    WantedBy=multi-user.target

i cant help you with services, but i can help you by pointing out that others can help you better if you present code, logfiles, yaml, etc. as a codeblock (as is mentioned at the top of every forum)

Sorry, I will edit :slight_smile: now that is a discovery… I love it

1 Like

I finally found the issue.
Just reporting for others: I installed AppDaemon in a virtual env and was not entering it before startup.

So added a line like this:
ExecStartPre=source yourpathtovirtualenv/bin/activate

fixed it

If you specify in the exec line the binary inside the venv, you do not need to activate the virtual environment separately, so this works

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

[Service]
Type=simple
User=homeassistant
Environment=PYTHONPATH=/home/homeassistant/.homeassistant/python_modules:${PYTHONPATH}
ExecStart=/home/homeassistant/appdaemon_venv/bin/appdaemon -c /home/homeassistant/.homeassistant
SendSIGKILL=no
Restart=on-abnormal

[Install]
WantedBy=multi-user.target
1 Like

thanks! I will do like that

I just noticed I still have the PYTHONPATH set in that snippet. It isn’t needed to start up, unless you have your own python libraries you want to include.