You are not logged in.

#1 2015-03-08 10:26:58

Lockheed
Member
Registered: 2010-03-16
Posts: 1,542

Start systemd service only after br0 receives IP address?

I have a fairly complex setup involving  br0, hostapd service and a VM managing DHCP for br0.

br0 receives IP from a pfSense running in a VM, but it takes some time before VM boots and assigns IP to br0 once the host system has started.
The hostapd service must start only after the IP has been assigned to br0, otherwise it will not work properly. Therefore, I am looking for a way to start it only after that IP has been assigned.

I cannot use something like

After=network.target

because it would make it start way to early.

Any ideas welcome.

Offline

#2 2015-03-08 10:54:25

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Start systemd service only after br0 receives IP address?

Try 'network-online.target', works here for mounting my NFS shares after the network comes up.

Offline

#3 2015-03-09 11:10:22

Lockheed
Member
Registered: 2010-03-16
Posts: 1,542

Re: Start systemd service only after br0 receives IP address?

tomk wrote:

Try 'network-online.target', works here for mounting my NFS shares after the network comes up.

This won't help because AFAIK it will start it as soon as eth0 gets an IP, which is about 1 minute earlier than br0 getting an IP.

Offline

#4 2015-03-09 13:43:09

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Start systemd service only after br0 receives IP address?

Well, how about using systemd-networkd-wait-online then? You can specify which interface to wait for.

Offline

Board footer

Powered by FluxBB