systemd: NFS server services should use network-online
Subsystems (2)
PATCH 1/1 systemd: NFS server services should use network-online
There has been an number startup problems where parts of the NFS server fails to start due to DNS and other parts of the network not be up.
Reading the systemd.special it seems network.target is a passive unit which does not wait for the entire network to come up and network-online.target is an active unit which does wait.
So this adds Wants=network-online.target to all of the NFS server services
--- systemd/nfs-mountd.service | 2 +- systemd/nfs-server.service | 4 ++-- systemd/rpc-statd-notify.service | 2 +- systemd/rpc-statd.service | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-)
systemd/nfs-mountd.service +1 -1
@@ -2,8 +2,8 @@ Description=NFS Mount Daemon DefaultDependencies=no Requires=proc-fs-nfsd.mount +Wants=network-online.target After=proc-fs-nfsd.mount -After=network.target local-fs.target After=rpcbind.socket BindsTo=nfs-server.service
systemd/nfs-server.service +2 -2
@@ -3,11 +3,11 @@ Description=NFS server and services DefaultDependencies=no Requires= network.target proc-fs-nfsd.mount Requires= nfs-mountd.service -Wants=rpcbind.socket +Wants=rpcbind.socket network-online.target Wants=rpc-statd.service nfs-idmapd.service Wants=rpc-statd-notify.service -After= local-fs.target network-online.target +After= local-fs.target After= proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service After= nfs-idmapd.service rpc-statd.service Before= rpc-statd-notify.service
systemd/rpc-statd-notify.service +1 -1
@@ -1,7 +1,7 @@ [Unit] Description=Notify NFS peers of a restart DefaultDependencies=no -Requires=network.target +Wants=network-online.target After=local-fs.target network.target nss-lookup.target # if we run an nfs server, it needs to be running before we
systemd/rpc-statd.service +2 -1
@@ -3,7 +3,8 @@ Description=NFS status monitor for NFSv2/3 locking. DefaultDependencies=no Conflicts=umount.target Requires=nss-lookup.target rpcbind.socket -After=network.target nss-lookup.target rpcbind.socket +Wants=network-online.target +After=nss-lookup.target rpcbind.socket PartOf=nfs-utils.service
Signature · 1 line
2.9.3
Quoted 9 lines · Steve Dickson
There has been an number startup problems where parts of the NFS server fails to start due to DNS and other parts of the network not be up.
Reading the systemd.special it seems network.target is a passive unit which does not wait for the entire network to come up and network-online.target is an active unit which does wait.
Quoted 4 lines
So this adds Wants=network-online.target to all of the NFS server services
Signed-off-by Steve Dickson <[email protected]>
Committed...
steved.
Quoted 67 lines
--- systemd/nfs-mountd.service | 2 +- systemd/nfs-server.service | 4 ++-- systemd/rpc-statd-notify.service | 2 +- systemd/rpc-statd.service | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-)systemd/nfs-mountd.service +1
-1@@ -2,8 +2,8 @@ Description=NFS Mount Daemon DefaultDependencies=no Requires=proc-fs-nfsd.mount +Wants=network-online.target After=proc-fs-nfsd.mount -After=network.target local-fs.target After=rpcbind.socket BindsTo=nfs-server.servicesystemd/nfs-server.service +2
-2@@ -3,11 +3,11 @@ Description=NFS server and services DefaultDependencies=no Requires= network.target proc-fs-nfsd.mount Requires= nfs-mountd.service -Wants=rpcbind.socket +Wants=rpcbind.socket network-online.target Wants=rpc-statd.service nfs-idmapd.service Wants=rpc-statd-notify.service -After= local-fs.target network-online.target +After= local-fs.target After= proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service After= nfs-idmapd.service rpc-statd.service Before= rpc-statd-notify.servicesystemd/rpc-statd-notify.service +1
-1@@ -1,7 +1,7 @@ [Unit] Description=Notify NFS peers of a restart DefaultDependencies=no -Requires=network.target +Wants=network-online.target After=local-fs.target network.target nss-lookup.target # if we run an nfs server, it needs to be running before wesystemd/rpc-statd.service +2
-1@@ -3,7 +3,8 @@ Description=NFS status monitor for NFSv2/3 locking. DefaultDependencies=no Conflicts=umount.target Requires=nss-lookup.target rpcbind.socket -After=network.target nss-lookup.target rpcbind.socket +Wants=network-online.target +After=nss-lookup.target rpcbind.socket PartOf=nfs-utils.service
Hello,
Quoted 11 lines · Steve Dickson
There has been an number startup problems where parts of the NFS server fails to start due to DNS and other parts of the network not be up.
Reading the systemd.special it seems network.target is a passive unit which does not wait for the entire network to come up and network-online.target is an active unit which does wait.
So this adds Wants=network-online.target to all of the NFS server services
I'm getting some push back on this patch because people are saying Requires= should be used not Wants= even though the man page ways wants...
The theory is Wants "not strong enough".
Any opinion on this? Here is the bz
https://bugzilla.redhat.com/show_bug.cgi?id=1419351
steved.
Quoted 69 lines
Signed-off-by Steve Dickson <[email protected]>--- systemd/nfs-mountd.service | 2 +- systemd/nfs-server.service | 4 ++-- systemd/rpc-statd-notify.service | 2 +- systemd/rpc-statd.service | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-)systemd/nfs-mountd.service +1
-1@@ -2,8 +2,8 @@ Description=NFS Mount Daemon DefaultDependencies=no Requires=proc-fs-nfsd.mount +Wants=network-online.target After=proc-fs-nfsd.mount -After=network.target local-fs.target After=rpcbind.socket BindsTo=nfs-server.servicesystemd/nfs-server.service +2
-2@@ -3,11 +3,11 @@ Description=NFS server and services DefaultDependencies=no Requires= network.target proc-fs-nfsd.mount Requires= nfs-mountd.service -Wants=rpcbind.socket +Wants=rpcbind.socket network-online.target Wants=rpc-statd.service nfs-idmapd.service Wants=rpc-statd-notify.service -After= local-fs.target network-online.target +After= local-fs.target After= proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service After= nfs-idmapd.service rpc-statd.service Before= rpc-statd-notify.servicesystemd/rpc-statd-notify.service +1
-1@@ -1,7 +1,7 @@ [Unit] Description=Notify NFS peers of a restart DefaultDependencies=no -Requires=network.target +Wants=network-online.target After=local-fs.target network.target nss-lookup.target # if we run an nfs server, it needs to be running before wesystemd/rpc-statd.service +2
-1@@ -3,7 +3,8 @@ Description=NFS status monitor for NFSv2/3 locking. DefaultDependencies=no Conflicts=umount.target Requires=nss-lookup.target rpcbind.socket -After=network.target nss-lookup.target rpcbind.socket +Wants=network-online.target +After=nss-lookup.target rpcbind.socket PartOf=nfs-utils.service