1

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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.