Discussion:
systemd-networkd-wait-online
(too old to reply)
Johannes Ernst
2017-12-05 20:21:24 UTC
Permalink
Raw Message
I’m running systemd 235.38 on an ARM64 device called the EspressoBin [1]. The EspressoBin board has an on-board Ethernet switch, which I configure with systemd-networkd (configuration is below). The device is intended as a home router that runs IPv4 masquerading, local DNS server etc.

I’m attempting to take action when the wan interface has a network connection to the upstream ISP. I discovered /usr/lib/systemd/systemd-networkd-wait-online, which behaves as follows:

% systemd-networkd-wait-online -i wan
Exactly what I would expect — once I connect upstream Ethernet, it prints "ignoring: lan0, lan1, eth0, lo” and returns true

% systemd-networkd-wait-online —ignore lan0 —ignore lan1
Same as first

% systemd-networkd-wait-online
“Hangs”

% systemd-networkd-wait-online -i lan0
“Hangs”

The way I read the man page [2] systemd-networkd-wait-online is supposed to return with true, even if only the wan interface is connected and the other two ports are configured (but not connected). Is my understanding correct? Or do all three ports need to be connected?

Thanks,



Johannes.



Configuration:

::::::::::::::
49-ubos-eth0.network
::::::::::::::
[Match]
Name=eth0

[Network]

::::::::::::::
50-ubos-lan0.network
::::::::::::::
[Match]
Name=lan0

[Network]
Address=192.168.140.1
DNS=192.168.140.1
IPForward=yes
BindCarrier=eth0

::::::::::::::
50-ubos-lan1.network
::::::::::::::
[Match]
Name=lan1

[Network]
Address=192.168.141.1
DNS=192.168.141.1
IPForward=yes
BindCarrier=eth0

::::::::::::::
50-ubos-wan.network
::::::::::::::
[Match]
Name=wan

[Network]
DHCP=yes
IPForward=yes
BindCarrier=eth0






[1] https://espressobin.net/
[2] https://www.freedesktop.org/software/systemd/man/systemd-networkd-wait-online.service.html
Lennart Poettering
2017-12-06 11:30:34 UTC
Permalink
Raw Message
On Di, 05.12.17 12:21, Johannes Ernst (***@gmail.com) wrote:

See the discussion on
https://github.com/systemd/systemd/issues/7478#issuecomment-348508263
regarding this kind of hardware.

Lennart
--
Lennart Poettering, Red Hat
Johannes Ernst
2017-12-09 04:54:39 UTC
Permalink
Raw Message
Thanks. I’m not surprised that work remains ...

Related question: systemd-networkd-wait-online.target seems to assume that once the network is online, it stays that way. I’d like to also take action when it goes down, and again when it comes back up. Any pointers how to best go about this? Is there an inverse of the systemd-networkd-wait-online executable?

Thanks,



Johannes.
Post by Lennart Poettering
See the discussion on
https://github.com/systemd/systemd/issues/7478#issuecomment-348508263
regarding this kind of hardware.
Lennart
--
Lennart Poettering, Red Hat
Lennart Poettering
2017-12-11 20:01:41 UTC
Permalink
Raw Message
Post by Johannes Ernst
Thanks. I’m not surprised that work remains ...
Related question: systemd-networkd-wait-online.target seems to
assume that once the network is online, it stays that way. I’d like
to also take action when it goes down, and again when it comes back
up. Any pointers how to best go about this? Is there an inverse of
the systemd-networkd-wait-online executable?
No, targets are not supposed to fully track system state. If you want
to track network up/down cycles use the rtnetlink API. Sorry.

Lennart
--
Lennart Poettering, Red Hat
Loading...