Open pinpox opened 2 years ago
I‘m able to reproduce this issue. A workaround for me was to add a dependency for dhcpcd to the service.
systemd.services.network-addresses-ens192 = {
after = [ "dhcpcd.service" ];
}
I guess there should be a better workaround - haven’t found the time yet!
the network config system is currently not well set up to have static configuration (like your route) depend on dynamic configuration (like gateways taken from dhcp). this may be a configuration that's possible with networkd, but with the scripted setup you're probably best off adding a fragment to networking.dhcpcd.runHook
that adds your route when the interface is fully configured
I can't judge if there is something to do here then. Maybe this should be documented or checked for in the service then? Maybe someone with more network stuff experience has a second opinion?
Is adding sleep 2s &&
into the service script will be correct?
*Faced the same problem in the network-setup-start
. Adding sleep
solved the problem, but not sure if it's correct way.
Describe the bug
Using this configuration to add a static route results in a failed unit during boot and no route created. Restarting the systemd unit succeeds and creates the route as intended, the problem seems to be that
network-addresses-enp0s20f0u4u1u1.service
does not wait until the network connection is ready.Routes before and after restarting the sytemd unit:
The issue can be fixed/worked around by adding:
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
Route is added and systemd unit does not require manual restart.
Notify maintainers
@witchof0x20 @Luflosi @symphorien @Artturin @pennae @MayNiklas
Metadata