Linux NFS development
 help / color / mirror / Atom feed
* [PATCH 0/3] Miscellaneous systemd changes
@ 2015-01-13 20:37 Steve Dickson
  2015-01-13 20:37 ` [PATCH 1/3] systemd: Bind rpc.idmapd to the nfs-server service Steve Dickson
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Steve Dickson @ 2015-01-13 20:37 UTC (permalink / raw)
  To: Linux NFS Mailing list; +Cc: Systemd Mailing List

Here are a few systemd changes that were suggested
by the systemd folks:

   * Bind the nfs-idmap service to the nfs server.
   * Correctly bind nfs-mountd service to the nfs server.
   * Used approved way to check if systemd is install and running

Steve Dickson (3):
  systemd: Bind rpc.idmapd to the nfs-server service
  systemd: Bind the nfs-mountd service to the nfs-server service
  start-statd: Use the canonical to check if systemd is running.

 systemd/nfs-idmapd.service | 2 +-
 systemd/nfs-mountd.service | 3 +--
 utils/statd/start-statd    | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

-- 
2.1.0


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

* [PATCH 1/3] systemd: Bind rpc.idmapd to the nfs-server service
  2015-01-13 20:37 [PATCH 0/3] Miscellaneous systemd changes Steve Dickson
@ 2015-01-13 20:37 ` Steve Dickson
  2015-01-14  9:46   ` [systemd-devel] " Michal Sekletar
  2015-01-13 20:37 ` [PATCH 2/3] systemd: Bind the nfs-mountd service " Steve Dickson
  2015-01-13 20:37 ` [PATCH 3/3] start-statd: Use the canonical to check if systemd is running Steve Dickson
  2 siblings, 1 reply; 7+ messages in thread
From: Steve Dickson @ 2015-01-13 20:37 UTC (permalink / raw)
  To: Linux NFS Mailing list; +Cc: Systemd Mailing List

Since rpc.idmapd is only used by the nfs server, to do 
its id mapping, bind the nfs-idmapd service to the 
nfs-server service so rpc.idmapd will be started 
and stopped with the nfs server.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 systemd/nfs-idmapd.service | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/systemd/nfs-idmapd.service b/systemd/nfs-idmapd.service
index 11895e2..61c9a64 100644
--- a/systemd/nfs-idmapd.service
+++ b/systemd/nfs-idmapd.service
@@ -1,7 +1,7 @@
 [Unit]
 Description=NFSv4 ID-name mapping service
 
-PartOf=nfs-utils.service
+BindTo=nfs-server.service
 
 Wants=nfs-config.service
 After=nfs-config.service
-- 
2.1.0


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

* [PATCH 2/3] systemd: Bind the nfs-mountd service to the nfs-server service
  2015-01-13 20:37 [PATCH 0/3] Miscellaneous systemd changes Steve Dickson
  2015-01-13 20:37 ` [PATCH 1/3] systemd: Bind rpc.idmapd to the nfs-server service Steve Dickson
@ 2015-01-13 20:37 ` Steve Dickson
  2015-01-13 20:37 ` [PATCH 3/3] start-statd: Use the canonical to check if systemd is running Steve Dickson
  2 siblings, 0 replies; 7+ messages in thread
From: Steve Dickson @ 2015-01-13 20:37 UTC (permalink / raw)
  To: Linux NFS Mailing list; +Cc: Systemd Mailing List

Use BindTo, instead of PartOf, to bind the nfs-mountd
service to the nfs-server service. Its a much tighter
bind than PartOf.

The Partof=nfs-utils.service was not needed.

One side effect of this tighter bond is when rpc.mountd
is stop, that will also bring the nfs server down,
due to the Requires=nfs-mountd.service in the 
nfs-server service

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

diff --git a/systemd/nfs-mountd.service b/systemd/nfs-mountd.service
index 7ccc0f7..c16af57 100644
--- a/systemd/nfs-mountd.service
+++ b/systemd/nfs-mountd.service
@@ -3,8 +3,7 @@ Description=NFS Mount Daemon
 Requires=proc-fs-nfsd.mount
 After=proc-fs-nfsd.mount
 After=network.target
-PartOf=nfs-server.service
-PartOf=nfs-utils.service
+BindTo=nfs-server.service
 
 Wants=nfs-config.service
 After=nfs-config.service
-- 
2.1.0


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

* [PATCH 3/3] start-statd: Use the canonical to check if systemd is running.
  2015-01-13 20:37 [PATCH 0/3] Miscellaneous systemd changes Steve Dickson
  2015-01-13 20:37 ` [PATCH 1/3] systemd: Bind rpc.idmapd to the nfs-server service Steve Dickson
  2015-01-13 20:37 ` [PATCH 2/3] systemd: Bind the nfs-mountd service " Steve Dickson
@ 2015-01-13 20:37 ` Steve Dickson
  2015-01-15 19:36   ` J. Bruce Fields
  2 siblings, 1 reply; 7+ messages in thread
From: Steve Dickson @ 2015-01-13 20:37 UTC (permalink / raw)
  To: Linux NFS Mailing list; +Cc: Systemd Mailing List

Use the approved way, define in
   http://www.freedesktop.org/software/systemd/man/sd_booted.html

to check if systemd is installed and running

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 utils/statd/start-statd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/statd/start-statd b/utils/statd/start-statd
index ec9383b..b32b3a5 100755
--- a/utils/statd/start-statd
+++ b/utils/statd/start-statd
@@ -7,7 +7,7 @@
 PATH="/sbin:/usr/sbin:/bin:/usr/bin"
 
 # First try systemd if it's installed.
-if systemctl --help >/dev/null 2>&1; then
+if test -d /run/systemd/system; then
     # Quit only if the call worked.
     systemctl start rpc-statd.service && exit
 fi
-- 
2.1.0


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

* Re: [systemd-devel] [PATCH 1/3] systemd: Bind rpc.idmapd to the nfs-server service
  2015-01-13 20:37 ` [PATCH 1/3] systemd: Bind rpc.idmapd to the nfs-server service Steve Dickson
@ 2015-01-14  9:46   ` Michal Sekletar
  2015-01-14 13:26     ` Steve Dickson
  0 siblings, 1 reply; 7+ messages in thread
From: Michal Sekletar @ 2015-01-14  9:46 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Linux NFS Mailing list, Systemd Mailing List

On Tue, Jan 13, 2015 at 03:37:35PM -0500, Steve Dickson wrote:
> Since rpc.idmapd is only used by the nfs server, to do 
> its id mapping, bind the nfs-idmapd service to the 
> nfs-server service so rpc.idmapd will be started 
> and stopped with the nfs server.
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
> ---
>  systemd/nfs-idmapd.service | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/systemd/nfs-idmapd.service b/systemd/nfs-idmapd.service
> index 11895e2..61c9a64 100644
> --- a/systemd/nfs-idmapd.service
> +++ b/systemd/nfs-idmapd.service
> @@ -1,7 +1,7 @@
>  [Unit]
>  Description=NFSv4 ID-name mapping service
>  
> -PartOf=nfs-utils.service
> +BindTo=nfs-server.service

Please note that actual name of the dependency is "BindsTo".

Michal

>  
>  Wants=nfs-config.service
>  After=nfs-config.service
> -- 
> 2.1.0
> 
> _______________________________________________
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel

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

* Re: [systemd-devel] [PATCH 1/3] systemd: Bind rpc.idmapd to the nfs-server service
  2015-01-14  9:46   ` [systemd-devel] " Michal Sekletar
@ 2015-01-14 13:26     ` Steve Dickson
  0 siblings, 0 replies; 7+ messages in thread
From: Steve Dickson @ 2015-01-14 13:26 UTC (permalink / raw)
  To: Michal Sekletar; +Cc: Linux NFS Mailing list, Systemd Mailing List



On 01/14/2015 04:46 AM, Michal Sekletar wrote:
> On Tue, Jan 13, 2015 at 03:37:35PM -0500, Steve Dickson wrote:
>> Since rpc.idmapd is only used by the nfs server, to do 
>> its id mapping, bind the nfs-idmapd service to the 
>> nfs-server service so rpc.idmapd will be started 
>> and stopped with the nfs server.
>>
>> Signed-off-by: Steve Dickson <steved@redhat.com>
>> ---
>>  systemd/nfs-idmapd.service | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/systemd/nfs-idmapd.service b/systemd/nfs-idmapd.service
>> index 11895e2..61c9a64 100644
>> --- a/systemd/nfs-idmapd.service
>> +++ b/systemd/nfs-idmapd.service
>> @@ -1,7 +1,7 @@
>>  [Unit]
>>  Description=NFSv4 ID-name mapping service
>>  
>> -PartOf=nfs-utils.service
>> +BindTo=nfs-server.service
> 
> Please note that actual name of the dependency is "BindsTo".
Got it.. Thanks!

steved.

> 
> Michal
> 
>>  
>>  Wants=nfs-config.service
>>  After=nfs-config.service
>> -- 
>> 2.1.0
>>
>> _______________________________________________
>> systemd-devel mailing list
>> systemd-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/systemd-devel

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

* Re: [PATCH 3/3] start-statd: Use the canonical to check if systemd is running.
  2015-01-13 20:37 ` [PATCH 3/3] start-statd: Use the canonical to check if systemd is running Steve Dickson
@ 2015-01-15 19:36   ` J. Bruce Fields
  0 siblings, 0 replies; 7+ messages in thread
From: J. Bruce Fields @ 2015-01-15 19:36 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Linux NFS Mailing list, Systemd Mailing List

On Tue, Jan 13, 2015 at 03:37:37PM -0500, Steve Dickson wrote:
> Use the approved way, define in
>    http://www.freedesktop.org/software/systemd/man/sd_booted.html
> 
> to check if systemd is installed and running
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
> ---
>  utils/statd/start-statd | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/utils/statd/start-statd b/utils/statd/start-statd
> index ec9383b..b32b3a5 100755
> --- a/utils/statd/start-statd
> +++ b/utils/statd/start-statd
> @@ -7,7 +7,7 @@
>  PATH="/sbin:/usr/sbin:/bin:/usr/bin"
>  
>  # First try systemd if it's installed.
> -if systemctl --help >/dev/null 2>&1; then
> +if test -d /run/systemd/system; then
>      # Quit only if the call worked.
>      systemctl start rpc-statd.service && exit
>  fi

In the case systemctl start fails it then falls back on 

   exec rpc.statd --no-notify

which is kind of unexpected.  It's going to be confusing having this
hand-started statd on a systemd distro.  Better just to fail cleanly.

So that "&& exit" should just be "; exit".

--b.

> -- 
> 2.1.0
> 
> --
> 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] 7+ messages in thread

end of thread, other threads:[~2015-01-15 19:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-13 20:37 [PATCH 0/3] Miscellaneous systemd changes Steve Dickson
2015-01-13 20:37 ` [PATCH 1/3] systemd: Bind rpc.idmapd to the nfs-server service Steve Dickson
2015-01-14  9:46   ` [systemd-devel] " Michal Sekletar
2015-01-14 13:26     ` Steve Dickson
2015-01-13 20:37 ` [PATCH 2/3] systemd: Bind the nfs-mountd service " Steve Dickson
2015-01-13 20:37 ` [PATCH 3/3] start-statd: Use the canonical to check if systemd is running Steve Dickson
2015-01-15 19:36   ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox