* [PATCH] rpcbind.service: Not pulling the rpcbind.target
@ 2017-12-14 17:05 Steve Dickson
2017-12-14 17:48 ` [systemd-devel] " Uoti Urpala
2017-12-14 18:05 ` Lennart Poettering
0 siblings, 2 replies; 6+ messages in thread
From: Steve Dickson @ 2017-12-14 17:05 UTC (permalink / raw)
To: Linux NFS Mailing list; +Cc: Systemd Mailing List
According to systemd.special(7) manpage:
rpcbind.target
The portmapper/rpcbind pulls in this target and orders itself before it, to indicate its availability. systemd automatically adds dependencies of type After= for this target unit to all SysV init script service units with an LSB header referring to the "$portmap" facility.
Signed-off-by: Steve Dickson <steved@redhat.com>
---
systemd/rpcbind.service.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in
index f8cfa9f..2b49c24 100644
--- a/systemd/rpcbind.service.in
+++ b/systemd/rpcbind.service.in
@@ -6,8 +6,8 @@ RequiresMountsFor=@statedir@
# Make sure we use the IP addresses listed for
# rpcbind.socket, no matter how this unit is started.
-Wants=rpcbind.socket
-After=rpcbind.socket
+Wants=rpcbind.socket rpcbind.target
+After=rpcbind.socket rpcbind.target
[Service]
Type=notify
--
2.14.3
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [systemd-devel] [PATCH] rpcbind.service: Not pulling the rpcbind.target 2017-12-14 17:05 [PATCH] rpcbind.service: Not pulling the rpcbind.target Steve Dickson @ 2017-12-14 17:48 ` Uoti Urpala 2017-12-14 18:24 ` Steve Dickson 2017-12-14 18:05 ` Lennart Poettering 1 sibling, 1 reply; 6+ messages in thread From: Uoti Urpala @ 2017-12-14 17:48 UTC (permalink / raw) To: Steve Dickson, Linux NFS Mailing list; +Cc: Systemd Mailing List On Thu, 2017-12-14 at 12:05 -0500, Steve Dickson wrote: > According to systemd.special(7) manpage: > > rpcbind.target > The portmapper/rpcbind pulls in this target and orders itself > before it, to indicate its availability. systemd automatically adds > dependencies of type After= for this target unit to all SysV init > script service units with an LSB header referring to the "$portmap" > facility. > diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in > index f8cfa9f..2b49c24 100644 > --- a/systemd/rpcbind.service.in > +++ b/systemd/rpcbind.service.in > @@ -6,8 +6,8 @@ RequiresMountsFor=@statedir@ > > # Make sure we use the IP addresses listed for > # rpcbind.socket, no matter how this unit is started. > -Wants=rpcbind.socket > -After=rpcbind.socket > +Wants=rpcbind.socket rpcbind.target > +After=rpcbind.socket rpcbind.target Is this needed when the service has socket activation support? If the only interaction with it is through the socket, it shouldn't matter even if the service is not actually up yet - clients can already open connections to the socket regardless. And regardless, that "After" for rpcbind.target seems backwards. Shouldn't it be "Before", so that the target being up signals that the service has already been started? Not directly related, but if that comment is accurate and the socket should be used "no matter what", perhaps that should be "Requires" instead of "Wants" so that if the socket could not be opened for some reason, the service fails instead of starting without socket activation? ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [systemd-devel] [PATCH] rpcbind.service: Not pulling the rpcbind.target 2017-12-14 17:48 ` [systemd-devel] " Uoti Urpala @ 2017-12-14 18:24 ` Steve Dickson 2017-12-14 18:47 ` Uoti Urpala 0 siblings, 1 reply; 6+ messages in thread From: Steve Dickson @ 2017-12-14 18:24 UTC (permalink / raw) To: Uoti Urpala, Linux NFS Mailing list; +Cc: Systemd Mailing List On 12/14/2017 12:48 PM, Uoti Urpala wrote: > On Thu, 2017-12-14 at 12:05 -0500, Steve Dickson wrote: >> According to systemd.special(7) manpage: >> >> rpcbind.target >> The portmapper/rpcbind pulls in this target and orders itself >> before it, to indicate its availability. systemd automatically adds >> dependencies of type After= for this target unit to all SysV init >> script service units with an LSB header referring to the "$portmap" >> facility. > > >> diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in >> index f8cfa9f..2b49c24 100644 >> --- a/systemd/rpcbind.service.in >> +++ b/systemd/rpcbind.service.in >> @@ -6,8 +6,8 @@ RequiresMountsFor=@statedir@ >> >> # Make sure we use the IP addresses listed for >> # rpcbind.socket, no matter how this unit is started. >> -Wants=rpcbind.socket >> -After=rpcbind.socket >> +Wants=rpcbind.socket rpcbind.target >> +After=rpcbind.socket rpcbind.target > > Is this needed when the service has socket activation support? If the > only interaction with it is through the socket, it shouldn't matter > even if the service is not actually up yet - clients can already open > connections to the socket regardless. Well things are working as is... but this man page paragraph was pointed out to me so I though these Wants and After were needed. So you saying this patch is not needed? > > And regardless, that "After" for rpcbind.target seems backwards. > Shouldn't it be "Before", so that the target being up signals that the > service has already been started? I think this makes sense... So if the patch is needed I'll add Before=rpcbind.target and remove the target from the After= > > Not directly related, but if that comment is accurate and the socket > should be used "no matter what", perhaps that should be "Requires" > instead of "Wants" so that if the socket could not be opened for some > reason, the service fails instead of starting without socket > activation? > I was afraid of opening a can a worms here... :-) So you are saying Wants and After should be changed to Requires=rpcbind.socket Before=rpcbind.target steved ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [systemd-devel] [PATCH] rpcbind.service: Not pulling the rpcbind.target 2017-12-14 18:24 ` Steve Dickson @ 2017-12-14 18:47 ` Uoti Urpala 2017-12-14 20:20 ` Steve Dickson 0 siblings, 1 reply; 6+ messages in thread From: Uoti Urpala @ 2017-12-14 18:47 UTC (permalink / raw) To: Steve Dickson, Linux NFS Mailing list; +Cc: Systemd Mailing List On Thu, 2017-12-14 at 13:24 -0500, Steve Dickson wrote: > > On 12/14/2017 12:48 PM, Uoti Urpala wrote: > > On Thu, 2017-12-14 at 12:05 -0500, Steve Dickson wrote: > > > +Wants=rpcbind.socket rpcbind.target > > > +After=rpcbind.socket rpcbind.target > > > > Is this needed when the service has socket activation support? If the > > only interaction with it is through the socket, it shouldn't matter > > even if the service is not actually up yet - clients can already open > > connections to the socket regardless. > > Well things are working as is... but this man page paragraph > was pointed out to me so I though these Wants and After were needed. > > So you saying this patch is not needed? I'm not familiar enough with rpcbind stuff to say with certainty that it wouldn't be needed, but at least it seems plausible to me that it would not be. The mechanism described on the man page is a way to implement ordering if needed, but if the early availability of the socket means ordering is never an issue, then it can be ignored. > > And regardless, that "After" for rpcbind.target seems backwards. > > Shouldn't it be "Before", so that the target being up signals that the > > service has already been started? > > I think this makes sense... So if the patch is needed I'll add > Before=rpcbind.target and remove the target from the After= Yes. > > Not directly related, but if that comment is accurate and the socket > > should be used "no matter what", perhaps that should be "Requires" > > instead of "Wants" so that if the socket could not be opened for some > > reason, the service fails instead of starting without socket > > activation? > > > > I was afraid of opening a can a worms here... :-) > > So you are saying Wants and After should be changed to > > Requires=rpcbind.socket > Before=rpcbind.target Depends on the exact semantics you want. "Wants" means that systemd will try to start the socket if the service is started, but will continue with the service start even if the dependency fails. "Requires" guarantees that the service will never be started without the socket active - if opening the socket fails, then the service start will return failure too. If you know that the socket unit should always be used, or the service will either fail or do the wrong thing without it (such as open a socket with parameters different from what was configured for the socket unit, and which the admin didn't expect) then Requires may be more appropriate. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [systemd-devel] [PATCH] rpcbind.service: Not pulling the rpcbind.target 2017-12-14 18:47 ` Uoti Urpala @ 2017-12-14 20:20 ` Steve Dickson 0 siblings, 0 replies; 6+ messages in thread From: Steve Dickson @ 2017-12-14 20:20 UTC (permalink / raw) To: Uoti Urpala, Linux NFS Mailing list; +Cc: Systemd Mailing List On 12/14/2017 01:47 PM, Uoti Urpala wrote: > On Thu, 2017-12-14 at 13:24 -0500, Steve Dickson wrote: >> >> On 12/14/2017 12:48 PM, Uoti Urpala wrote: >>> On Thu, 2017-12-14 at 12:05 -0500, Steve Dickson wrote: >>>> +Wants=rpcbind.socket rpcbind.target >>>> +After=rpcbind.socket rpcbind.target >>> >>> Is this needed when the service has socket activation support? If the >>> only interaction with it is through the socket, it shouldn't matter >>> even if the service is not actually up yet - clients can already open >>> connections to the socket regardless. >> >> Well things are working as is... but this man page paragraph >> was pointed out to me so I though these Wants and After were needed. >> >> So you saying this patch is not needed? > > I'm not familiar enough with rpcbind stuff to say with certainty that > it wouldn't be needed, but at least it seems plausible to me that it > would not be. The mechanism described on the man page is a way to > implement ordering if needed, but if the early availability of the > socket means ordering is never an issue, then it can be ignored. > > >>> And regardless, that "After" for rpcbind.target seems backwards. >>> Shouldn't it be "Before", so that the target being up signals that the >>> service has already been started? >> >> I think this makes sense... So if the patch is needed I'll add >> Before=rpcbind.target and remove the target from the After= > > Yes. > >>> Not directly related, but if that comment is accurate and the socket >>> should be used "no matter what", perhaps that should be "Requires" >>> instead of "Wants" so that if the socket could not be opened for some >>> reason, the service fails instead of starting without socket >>> activation? >>> >> >> I was afraid of opening a can a worms here... :-) >> >> So you are saying Wants and After should be changed to >> >> Requires=rpcbind.socket >> Before=rpcbind.target > > Depends on the exact semantics you want. "Wants" means that systemd > will try to start the socket if the service is started, but will > continue with the service start even if the dependency fails. > "Requires" guarantees that the service will never be started without > the socket active - if opening the socket fails, then the service start > will return failure too. If you know that the socket unit should always > be used, or the service will either fail or do the wrong thing without > it (such as open a socket with parameters different from what was > configured for the socket unit, and which the admin didn't expect) then > Requires may be more appropriate. I think I agree with you... thanks! steved. > > -- > 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] 6+ messages in thread
* Re: [systemd-devel] [PATCH] rpcbind.service: Not pulling the rpcbind.target 2017-12-14 17:05 [PATCH] rpcbind.service: Not pulling the rpcbind.target Steve Dickson 2017-12-14 17:48 ` [systemd-devel] " Uoti Urpala @ 2017-12-14 18:05 ` Lennart Poettering 1 sibling, 0 replies; 6+ messages in thread From: Lennart Poettering @ 2017-12-14 18:05 UTC (permalink / raw) To: Steve Dickson; +Cc: Linux NFS Mailing list, Systemd Mailing List On Do, 14.12.17 12:05, Steve Dickson (steved@redhat.com) wrote: > According to systemd.special(7) manpage: > > rpcbind.target > The portmapper/rpcbind pulls in this target and > orders itself before it, to indicate its availability. systemd > automatically adds dependencies of type After= for this target > unit to all SysV init script service units with an LSB header > referring to the "$portmap" facility. > > Signed-off-by: Steve Dickson <steved@redhat.com> > --- > systemd/rpcbind.service.in | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in > index f8cfa9f..2b49c24 100644 > --- a/systemd/rpcbind.service.in > +++ b/systemd/rpcbind.service.in > @@ -6,8 +6,8 @@ RequiresMountsFor=@statedir@ > > # Make sure we use the IP addresses listed for > # rpcbind.socket, no matter how this unit is started. > -Wants=rpcbind.socket > -After=rpcbind.socket > +Wants=rpcbind.socket rpcbind.target > +After=rpcbind.socket rpcbind.target The last line should be: After=rpcbind.socket Before=rpcbind.target Lennart -- Lennart Poettering, Red Hat ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-12-14 20:20 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-12-14 17:05 [PATCH] rpcbind.service: Not pulling the rpcbind.target Steve Dickson 2017-12-14 17:48 ` [systemd-devel] " Uoti Urpala 2017-12-14 18:24 ` Steve Dickson 2017-12-14 18:47 ` Uoti Urpala 2017-12-14 20:20 ` Steve Dickson 2017-12-14 18:05 ` Lennart Poettering
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox