Fishing around on how to autostart AD, this is the closest thread I can find on the topic:
Tried:
sudo systemctl enable appdaemon.service
and returned with:
Failed to execute operation: No such file or directory.
Do I need to create a file appdaemon.service (ensuring I’v got the correct paths) with contents below in /etc/systemd/system/? :
Sample unit file for systemd
Edit top suit your environment, then copy to /etc/systemd/system
run “systemd enable appdaemon” to make it start at boottime
[Unit]
Description=AppDaemon service for Home Assistant
[Service]
ExecStart=/usr/local/bin/appdaemon
If you are not using a default path for the config file use this:
The above script will work, but it will run appdaemon as root user. This runs, but is dangerous as any scripts have privileges to do anything to your system.
I use this script to run appdaemon as the homeassistant user. Note the name of the script has changed to [email protected], which has reduced privileges, so the apps can’t do anything too catastrophic to the system.
pi@raspberrypi:~
$ cat /etc/systemd/system/[email protected]
#
# Sample unit file for systemd
#
# Edit top suit your environment, then copy to /etc/systemd/system
#
# run "systemd enable appdaemon" to make it start at boottime
#
[Unit]
Description=AppDaemon service for %i
After=network.target mosquitto.service
[Service]
Type=simple
User=%i
ExecStart=/srv/homeassistant/bin/appdaemon -c /home/homeassistant/.homeassistant/appdaemon.cfg
Restart=on-failure
#
# If you are not using a default path for the config file use this:
#
#ExecStart=/usr/local/bin/appdaemon -c <path to config file>
#
[Install]
WantedBy=multi-user.target
Thought I share my experience of getting appdaemon to work on startup, in summary: ahhh #!#@$#$#!
But I got there.
pretty easy steps of course once you worked it out:
modify the appdaemon.service in the appdaemon\scripts directory using: nano appdaemon.service
cd /etc/systemd/system
3.copy the file as follows: sudo cp /home/pi/appdaemon/scripts/appdaemon.service /etc/systemd/system/appdaemon.service
sudo systemctl start appdaemon
check to ensure all is happy with: sudo systemctl status appdaemon