All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] systemd: nfs-server service should use network-online
@ 2017-04-07 15:07 Steve Dickson
  2017-04-09 19:01 ` Steve Dickson
  2017-04-10  1:12 ` NeilBrown
  0 siblings, 2 replies; 5+ messages in thread
From: Steve Dickson @ 2017-04-07 15:07 UTC (permalink / raw)
  To: Linux NFS Mailing list

There has been an number startup problems where parts of
the NFS server fail 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 and network-online.target
is an active unit which does not wait so that
should be used.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1419351

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 systemd/nfs-server.service | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
index 5be5de6..7cf4ae0 100644
--- a/systemd/nfs-server.service
+++ b/systemd/nfs-server.service
@@ -7,8 +7,8 @@ Wants=rpcbind.socket
 Wants=rpc-statd.service nfs-idmapd.service
 Wants=rpc-statd-notify.service
 
-After= local-fs.target
-After= network.target proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
+After= local-fs.target network-online.target
+After= proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
 After= nfs-idmapd.service rpc-statd.service
 Before= rpc-statd-notify.service
 
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] systemd: nfs-server service should use network-online
  2017-04-07 15:07 [PATCH] systemd: nfs-server service should use network-online Steve Dickson
@ 2017-04-09 19:01 ` Steve Dickson
  2017-04-10  1:12 ` NeilBrown
  1 sibling, 0 replies; 5+ messages in thread
From: Steve Dickson @ 2017-04-09 19:01 UTC (permalink / raw)
  To: Linux NFS Mailing list



On 04/07/2017 11:07 AM, Steve Dickson wrote:
> There has been an number startup problems where parts of
> the NFS server fail 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 and network-online.target
> is an active unit which does not wait so that
> should be used.
> 
> Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1419351
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed... 

steved.

> ---
>  systemd/nfs-server.service | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
> index 5be5de6..7cf4ae0 100644
> --- a/systemd/nfs-server.service
> +++ b/systemd/nfs-server.service
> @@ -7,8 +7,8 @@ Wants=rpcbind.socket
>  Wants=rpc-statd.service nfs-idmapd.service
>  Wants=rpc-statd-notify.service
>  
> -After= local-fs.target
> -After= network.target proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
> +After= local-fs.target network-online.target
> +After= proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
>  After= nfs-idmapd.service rpc-statd.service
>  Before= rpc-statd-notify.service
>  
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] systemd: nfs-server service should use network-online
  2017-04-07 15:07 [PATCH] systemd: nfs-server service should use network-online Steve Dickson
  2017-04-09 19:01 ` Steve Dickson
@ 2017-04-10  1:12 ` NeilBrown
  2017-04-10 10:58   ` Steve Dickson
  1 sibling, 1 reply; 5+ messages in thread
From: NeilBrown @ 2017-04-10  1:12 UTC (permalink / raw)
  To: Steve Dickson, Linux NFS Mailing list

[-- Attachment #1: Type: text/plain, Size: 1846 bytes --]

On Fri, Apr 07 2017, Steve Dickson wrote:

> There has been an number startup problems where parts of
> the NFS server fail 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 and network-online.target
> is an active unit which does not wait so that
> should be used.

I assume that last "not" should not be there?

According to systemd.special, we should add
  Wants=network-online.target
though "Requires" is probably OK.

nfs-server.service already has
 Requires= network.target
which you didn't change.

Also nfs-mountd rpc-statd-notify and rpc.statd all have
 After = network.target

They should probably be changed too ??

Thanks,
NeilBrown


>
> Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1419351
>
> Signed-off-by: Steve Dickson <steved@redhat.com>
> ---
>  systemd/nfs-server.service | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
> index 5be5de6..7cf4ae0 100644
> --- a/systemd/nfs-server.service
> +++ b/systemd/nfs-server.service
> @@ -7,8 +7,8 @@ Wants=rpcbind.socket
>  Wants=rpc-statd.service nfs-idmapd.service
>  Wants=rpc-statd-notify.service
>  
> -After= local-fs.target
> -After= network.target proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
> +After= local-fs.target network-online.target
> +After= proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
>  After= nfs-idmapd.service rpc-statd.service
>  Before= rpc-statd-notify.service
>  
> -- 
> 2.9.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] systemd: nfs-server service should use network-online
  2017-04-10  1:12 ` NeilBrown
@ 2017-04-10 10:58   ` Steve Dickson
  2017-04-10 21:35     ` NeilBrown
  0 siblings, 1 reply; 5+ messages in thread
From: Steve Dickson @ 2017-04-10 10:58 UTC (permalink / raw)
  To: NeilBrown, Linux NFS Mailing list



On 04/09/2017 09:12 PM, NeilBrown wrote:
> On Fri, Apr 07 2017, Steve Dickson wrote:
> 
>> There has been an number startup problems where parts of
>> the NFS server fail 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 and network-online.target
>> is an active unit which does not wait so that
>> should be used.
> 
> I assume that last "not" should not be there?
Right... 
> 
> According to systemd.special, we should add
>   Wants=network-online.target
> though "Requires" is probably OK.
I did see that... but the bug report said After= 
worked so I went with that... 

> 
> nfs-server.service already has
>  Requires= network.target
> which you didn't change.
> 
> Also nfs-mountd rpc-statd-notify and rpc.statd all have
>  After = network.target
> 
> They should probably be changed too ??
yup... good call.

steved.

> 
> Thanks,
> NeilBrown
> 
> 
>>
>> Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1419351
>>
>> Signed-off-by: Steve Dickson <steved@redhat.com>
>> ---
>>  systemd/nfs-server.service | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
>> index 5be5de6..7cf4ae0 100644
>> --- a/systemd/nfs-server.service
>> +++ b/systemd/nfs-server.service
>> @@ -7,8 +7,8 @@ Wants=rpcbind.socket
>>  Wants=rpc-statd.service nfs-idmapd.service
>>  Wants=rpc-statd-notify.service
>>  
>> -After= local-fs.target
>> -After= network.target proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
>> +After= local-fs.target network-online.target
>> +After= proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
>>  After= nfs-idmapd.service rpc-statd.service
>>  Before= rpc-statd-notify.service
>>  
>> -- 
>> 2.9.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] systemd: nfs-server service should use network-online
  2017-04-10 10:58   ` Steve Dickson
@ 2017-04-10 21:35     ` NeilBrown
  0 siblings, 0 replies; 5+ messages in thread
From: NeilBrown @ 2017-04-10 21:35 UTC (permalink / raw)
  To: Steve Dickson, Linux NFS Mailing list

[-- Attachment #1: Type: text/plain, Size: 2883 bytes --]

On Mon, Apr 10 2017, Steve Dickson wrote:

> On 04/09/2017 09:12 PM, NeilBrown wrote:
>> On Fri, Apr 07 2017, Steve Dickson wrote:
>> 
>>> There has been an number startup problems where parts of
>>> the NFS server fail 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 and network-online.target
>>> is an active unit which does not wait so that
>>> should be used.
>> 
>> I assume that last "not" should not be there?
> Right... 
>> 
>> According to systemd.special, we should add
>>   Wants=network-online.target
>> though "Requires" is probably OK.
> I did see that... but the bug report said After= 
> worked so I went with that... 

I think that is dangerous, though obviously not very...

On my openSUSE system,
  systemctl show network-online.target | grep By=
only shows
  WantedBy=winbind.service

If I didn't have winbind installed, nothing would want the .target, so
it wouldn't be activated, so nfs-server wouldn't be ordered with it.

The network still comes up because the services that activate it are
WantedBy=multi-user.target
so nfs-server will (eventually) work, but there is no guarantee of
ordering.
I think it would be safest to follow the man page and Want or Require
network-online.target, rather than assume that something else will.

Thanks,
NeilBrown


>
>> 
>> nfs-server.service already has
>>  Requires= network.target
>> which you didn't change.
>> 
>> Also nfs-mountd rpc-statd-notify and rpc.statd all have
>>  After = network.target
>> 
>> They should probably be changed too ??
> yup... good call.
>
> steved.
>
>> 
>> Thanks,
>> NeilBrown
>> 
>> 
>>>
>>> Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1419351
>>>
>>> Signed-off-by: Steve Dickson <steved@redhat.com>
>>> ---
>>>  systemd/nfs-server.service | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
>>> index 5be5de6..7cf4ae0 100644
>>> --- a/systemd/nfs-server.service
>>> +++ b/systemd/nfs-server.service
>>> @@ -7,8 +7,8 @@ Wants=rpcbind.socket
>>>  Wants=rpc-statd.service nfs-idmapd.service
>>>  Wants=rpc-statd-notify.service
>>>  
>>> -After= local-fs.target
>>> -After= network.target proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
>>> +After= local-fs.target network-online.target
>>> +After= proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
>>>  After= nfs-idmapd.service rpc-statd.service
>>>  Before= rpc-statd-notify.service
>>>  
>>> -- 
>>> 2.9.3
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-10 21:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-07 15:07 [PATCH] systemd: nfs-server service should use network-online Steve Dickson
2017-04-09 19:01 ` Steve Dickson
2017-04-10  1:12 ` NeilBrown
2017-04-10 10:58   ` Steve Dickson
2017-04-10 21:35     ` NeilBrown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.