if you have a component that accesses network at startup, After=network-online.target
may not be sufficient. In my case, dns resolution was failing for my component when it accessed network at startup, probably because systemd was starting hass too early.
The following helped me: https://unix.stackexchange.com/a/356189/62292
My systemd file is:
[Unit]
Description=Home Assistant
After=NetworkManager-wait-online.service
Requires=NetworkManager-wait-online.service
[Service]
Type=simple
User=%i
WorkingDirectory=/home/%i/.homeassistant
ExecStart=/srv/homeassistant/bin/hass -c "/home/%i/.homeassistant"
[Install]
More info about my machine (standard Manjaro KDE)
[xxxxx@computer ~]$ systemctl is-enabled NetworkManager-wait-online.service systemd-networkd-wait-online.service
enabled
disabled