You are not logged in.

#1 2023-01-13 23:59:55

hwallace
Member
Registered: 2021-08-30
Posts: 82

[SOLVED]systemd-wait-online -- need clarification on process

:> uname -a
Linux meer 6.1.5-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 12 Jan 2023 22:42:33 +0000 x86_64 GNU/Linux

I have three network devices and my network is taking over 7 seconds to come up.


:> systemd-analyze blame
6.546s systemd-networkd-wait-online.service

On this LAN that's a long time. I'm not concerned very much about this but I mention it because it might be useful for diagnosis.
     
Yes, there's three devices but I have a `wait-online` override that adds the `--any` flag

### Editing /etc/systemd/system/systemd-networkd-wait-online.service.d/override.
conf
### Anything between here and the comment below will become the new contents of 
the file

[Service]
ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --any

### Lines below this comment will be discarded

I have three systemd.networkd files

    > ls /etc/systemd/network/*.network
    /etc/systemd/network/100-eno1.network 
        - onboard ethernet
        - routing metric 1000
    /etc/systemd/network/200-usb01.network 
        - usb-ethernet
        - routing metric 5000
    /etc/systemd/network/500-wlan0.network 
        - wifi
        - routing metric 6000
        

Systemd reads these in lexical order so : 100,200,500 correct?


   
But this snip from journal suggests that order is not used. I don't understand these things:
- wlan0 is mentioned first yet is lexically last
- wlan0 struggles to stay up but
- eno1 is UP and stable. This should satisfy *--any* but apparently
   does not
- wait-online continues until wlan0 is up at which point the wait
   finishes and we then go on to usb01
   
On a guess I'd say that systemd requires wifi before being satisfied even though the configuration tries to deprioritise it to last

     journalctl -b -u systemd-networkd -u systemd-networkd-wait-online.service
     2023-01-07T07:01:11.167377-0800 meer systemd[1]: Starting Network Configuration...
     2023-01-07T07:01:11.259477-0800 meer systemd-networkd[310]: lo: Link UP
     2023-01-07T07:01:11.259482-0800 meer systemd-networkd[310]: lo: Gained carrier
     2023-01-07T07:01:11.259789-0800 meer systemd-networkd[310]: Enumeration completed
     2023-01-07T07:01:11.270757-0800 meer systemd[1]: Started Network Configuration.
     2023-01-07T07:01:11.286993-0800 meer systemd[1]: Starting Wait for Network to be Configured...
     2023-01-07T07:01:12.152228-0800 meer systemd-networkd-wait-online[351]: wlan0: Failed to update link state, ignoring: No such file or directory
     2023-01-07T07:01:12.365857-0800 meer systemd-networkd-wait-online[351]: eth0: Failed to update link state, ignoring: No such file or directory
     2023-01-07T07:01:12.454141-0800 meer systemd-networkd[310]: wlan0: found matching network '/etc/systemd/network/500-wlan0.network', based on potentially unpredictable inter>
     2023-01-07T07:01:12.454149-0800 meer systemd-networkd[310]: wlan0: Configuring with /etc/systemd/network/500-wlan0.network.
     2023-01-07T07:01:12.673305-0800 meer systemd-networkd[310]: eth0: Interface name change detected, renamed to eno1.
     2023-01-07T07:01:12.673353-0800 meer systemd-networkd[310]: wlan0: Link UP
     2023-01-07T07:01:12.674112-0800 meer systemd-networkd[310]: eno1: Configuring with /etc/systemd/network/100-eno1.network.
     2023-01-07T07:01:12.860420-0800 meer systemd-networkd[310]: eno1: Link UP
     2023-01-07T07:01:12.909088-0800 meer systemd-networkd[310]: wlan0: Link DOWN
     2023-01-07T07:01:12.970441-0800 meer systemd-networkd-wait-online[351]: wlan0: Failed to update link state, ignoring: No such file or directory
     2023-01-07T07:01:13.161606-0800 meer systemd-networkd[310]: wlan0: Link UP
     2023-01-07T07:01:13.172932-0800 meer systemd-networkd[310]: wlan0: Configuring with /etc/systemd/network/500-wlan0.network.
     2023-01-07T07:01:15.702912-0800 meer systemd-networkd[310]: eno1: Gained carrier
     2023-01-07T07:01:17.130156-0800 meer systemd-networkd[310]: eno1: Gained IPv6LL
     2023-01-07T07:01:17.815648-0800 meer systemd-networkd[310]: eno1: ....
     2023-01-07T07:01:18.091443-0800 meer systemd-networkd[310]: wlan0: Connected WiFi access point: Hymanwallace (f ...
     2023-01-07T07:01:18.212614-0800 meer systemd-networkd[310]: wlan0: Gained carrier
     2023-01-07T07:01:19.233866-0800 meer systemd-networkd[310]: wlan0: Gained IPv6LL
     2023-01-07T07:01:19.877409-0800 meer systemd[1]: Finished Wait for Network to be Configured.
     2023-01-07T07:01:20.001854-0800 meer systemd-networkd[310]: wlan0: DHCPv6 address .....
     2023-01-07T07:01:56.397053-0800 meer systemd-networkd[310]: eth0: Interface name change detected, renamed to usb01.
     2023-01-07T07:01:56.461015-0800 meer systemd-networkd[310]: usb01: Configuring with /etc/systemd/network/200-usb01.network.
     2023-01-07T07:01:56.468578-0800 meer systemd-networkd[310]: usb01: Link UP
     2023-01-07T07:01:59.058539-0800 meer systemd-networkd[310]: usb01: Gained carrier
     2023-01-07T07:02:00.886867-0800 meer systemd-networkd[310]: usb01: Gained IPv6LL
     2023-01-07T07:02:01.996701-0800 meer systemd-networkd[310]: usb01: DHCPv6 

I want the 100 file read first and I want the system up after that `eno1` is up.

Where is the error in my understanding?
How can I correct the configuration?

Last edited by hwallace (2023-01-14 17:12:15)

Offline

#2 2023-01-14 10:12:14

Raynman
Member
Registered: 2011-10-22
Posts: 1,502

Re: [SOLVED]systemd-wait-online -- need clarification on process

The order of .network files only matters for matching config files to interfaces (first match wins). It appears the configuration of the wired connection starts slightly later because, unlike wlan0, it gets renamed first.

The real problem is the override: it adds a second ExecStart line to the one that's in the unit file (oneshot can have multiple commands) instead of replacing the line without `--any`. See the second example here: https://wiki.archlinux.org/title/Systemd#Examples

Offline

#3 2023-01-14 17:11:12

hwallace
Member
Registered: 2021-08-30
Posts: 82

Re: [SOLVED]systemd-wait-online -- need clarification on process

Thanks. That explains so much.

Offline

Board footer

Powered by FluxBB