You are not logged in.

#1 2023-08-22 10:43:36

go4linux
Member
Registered: 2018-07-04
Posts: 19

[SOLVED] network-online.target done when network not ready?

I have a server with an NFS share that I mount on my desktop.
I was having problems with the mount done in /etc/fstab (using _netdev), which was often (not always) failing because of network unreachable, so I decided to explicitly set a dependency on the network.
I created a server.mount file, with the following unit section:

[Unit]
Documentation=man:systemd.mount(5)
Requires=network-online.target

Now, looking at the logs, it seems indeed that the server.mount is started right after network-online, yet the network is unreachable.

The server.mount log:

Aug 22 10:48:18.543363 desktop systemd[1]: Failed to mount /server.
Aug 22 10:48:18.487212 desktop systemd[1]: server.mount: Failed with result 'exit-code'.
Aug 22 10:48:18.487207 desktop systemd[1]: server.mount: Mount process exited, code=exited, status=32/>
Aug 22 10:48:18.486563 desktop mount[842]: mount.nfs: Network is unreachable for server:/ on /server
Aug 22 10:48:18.324963 desktop systemd[1]: Mounting /server...

The network-online log:

Aug 22 10:48:18.323805 desktop.desole.org systemd[1]: Reached target Network is Online.

When I start server.mount manually it works every time, as did the mount command when I was using /etc/fstab instead of a dedicated server.mount file.
Also, I use network manager, but I see that NetworkManager-wait-online.service still comes before network-online.
I really have no idea about what is going on. Any help appreciated.

Last edited by go4linux (2023-08-22 19:44:48)

Offline

#2 2023-08-22 13:56:42

seth
Member
Registered: 2012-09-03
Posts: 51,326

Online

#3 2023-08-22 19:44:29

go4linux
Member
Registered: 2018-07-04
Posts: 19

Re: [SOLVED] network-online.target done when network not ready?

I see.
I have to say that I am one of those who consider a network to be online when it's usable, with an IP address and everything.
Maybe it would make sense to have a network-online.target and a network-really-online.target :-)
Anyway, going back to fstab and using x-systemd.automount seems to work. I will see how it goes in the coming weeks.
Thank you, I will put this as solved

Offline

Board footer

Powered by FluxBB