[systemd-devel] Starting a service before any networking

Mantas Mikulėnas grawity at gmail.com
Tue Sep 26 18:38:04 UTC 2023


On 2023-09-26 21:31, Mark Rogers wrote:
> On Tue, 26 Sept 2023 at 13:44, Mantas Mikulėnas <grawity at gmail.com 
> <mailto:grawity at gmail.com>> wrote:

>     I'm still not entirely sure of the situation but right now it sounds
>     like the configuration is okay but the Ethernet interface is failing
>     to establish a physical link on the first try. Does it also show
>     "<UP,NO_CARRIER>" within the interface flags?
> 
> 
> eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast 
> state DOWN group default qlen 1000
> 
> I've done a lot more testing now and there's a race condition somewhere 
> as it does sometimes (rarely) boot OK and get an IP address with no 
> config changes.

That's not a race condition; it's a fault in the network interface 
itself. "NO-CARRIER" means it's physically unable to establish the 
Ethernet link – an external condition that the service ordering has no 
effect on.

(The interface *is* already brought "up" – in the `ip link set` sense – 
because it shows the <UP> flag, which was probably done by dhcpcd when 
it started up; now the DHCP client is sitting there waiting for carrier 
before it can do anything else.)

At this stage ordering is not a problem because dhcpcd, like any 
self-respecting DHCP client, is able to monitor carrier status; it 
doesn't just immediately give up.


More information about the systemd-devel mailing list