systemd unit config that waits for PPPoe connection
3
votes
1
answer
729
views
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?
Asked by davegravy
(193 rep)
Mar 6, 2019, 05:16 AM
Last activity: May 25, 2023, 07:37 AM
Last activity: May 25, 2023, 07:37 AM