3

On Ubuntu 16.04LTS I'm having trouble getting my service to wait for my PPPoe internet connection before starting.

My unit file:

[Unit] Description=Home Assistant Wants=network-online.target After=network-online.target [Service] Type=simple User=%i ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant" [Install] WantedBy=multi-user.target 

My /etc/network/interfaces:

auto lo iface lo inet loopback auto enp4s0 iface enp4s0 inet manual mtu 1508 auto enp4s0.35 iface enp4s0.35 inet manual vlan-raw-device enp4s0 mtu 1508 auto wan iface wan inet ppp provider bell auto enp3s0 iface enp3s0 inet static address 192.168.80.1 network 192.168.80.0 broadcast 192.168.80.255 

If I run pon bell there is a considerable delay (10-20s) between the command finishing execution and when the interface appears in ifconfig.

I believe homeassistant is starting early because its logs contain errors about failing to reach public endpoints, which doesn't occur if I restart the service manually after boot.

How can I get the service to wait properly?

1 Answer 1

0

If your configuration for hass uses domain names instead of IP addresses, you could try to add nss-lookup.target at the end, after a space, on the After= line...

https://www.freedesktop.org/software/systemd/man/systemd.special.html#nss-lookup.target

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.