All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/6] systemd: add nfs-utils_env.sh for SUSE.
  2014-02-20  6:55 [nfs-utils/systemd PATCH 0/6] Assorted fixes for systemd units Neil Brown
                   ` (4 preceding siblings ...)
  2014-02-20  6:55 ` [PATCH 2/6] systemd units: create nfs-config.service as single location to process config Neil Brown
@ 2014-02-20  6:55 ` Neil Brown
  2014-03-23 19:14   ` Steve Dickson
  2014-03-24 13:37 ` [nfs-utils/systemd PATCH 0/6] Assorted fixes for systemd units Steve Dickson
  6 siblings, 1 reply; 13+ messages in thread
From: Neil Brown @ 2014-02-20  6:55 UTC (permalink / raw)
  To: Steve Dickson; +Cc: linux-nfs

This script provides the required translation for
sysconfig variables understood by init.d script on openSUSE.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 systemd/SUSE-nfs-utils_env.sh |   62 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100644 systemd/SUSE-nfs-utils_env.sh

diff --git a/systemd/SUSE-nfs-utils_env.sh b/systemd/SUSE-nfs-utils_env.sh
new file mode 100644
index 000000000000..8d6d94ed29e5
--- /dev/null
+++ b/systemd/SUSE-nfs-utils_env.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# extract configuration from /etc/sysconfig/nfs-utils and write
+# environment to /run/sysconfig/nfs-utils to be used by systemd unit
+# files.
+# This script expect configuration as used by openSUSE-13.1 and later
+#
+
+nfs_config=/etc/sysconfig/nfs
+if test -r $nfs_config; then
+    . $nfs_config
+fi
+
+pipefs=
+if [ -n "$RPC_PIPEFS_DIR" -a "$RPC_PIPEFS_DIR" != "/var/lib/nfs/rpc_pipefs" ]; then
+    pipefs="-p /var/lib/nfs/rpc_pipefs"
+fi
+
+mountdport=
+if [ -n "$MOUNTD_PORT" ]; then
+    mountdport="-p $MOUNTD_PORT"
+fi
+
+case $NFS_GSSD_AVOID_DNS in
+    [Nn]*) ignore_dns=-D ;;
+    [Yy]*) ignore_dns=   ;;
+    *    ) ignore_dns=-D
+esac
+
+version_params=
+if [ "$NFS3_SERVER_SUPPORT" == "no" ]; then
+   version_params="--no-nfs-version 2 --no-nfs-version 3"
+fi
+if [ "$NFS4_SUPPORT" != "yes" ]; then
+   version_params="--no-nfs-version 4"
+fi
+if [ "$NFS4_SERVER_MINOR_VERSION" != "0" ]; then
+   version_params="$VERSION_PARAMS --nfs-version 4 --nfs-version 4.$NFS4_SERVER_MINOR_VERSION"
+fi
+
+if [ "$USE_KERNEL_NFSD_NUMBER" -gt 0 ]; then
+    threads=$USE_KERNEL_NFSD_NUMBER
+else
+    threads=3
+fi
+
+case $NFS_GSSD_AVOID_DNS in
+    [Nn]*) ignore_dns=-D ;;
+    [Yy]*) ignore_dns=   ;;
+    *    ) ignore_dns=-D
+esac
+
+mkdir -p /run/sysconfig
+{
+echo "RPCIDMAPDARGS=$pipefs"
+echo "RPCMOUNTDARGS=$mountdport $MOUNTD_OPTIONS $version_parms"
+echo "RPCNFSDARGS=$NFSD_OPTIONS $version_params $threads"
+echo "GSSDARGS=$ignore_dns $GSSD_OPTIONS $pipefs"
+echo "SMNOTIFYARGS=$SM_NOTIFY_OPTIONS"
+echo "STATDARGS=$STATD_OPTIONS"
+echo "SVCGSSDARGS=$SVCGSSD_OPTIONS"
+} > /run/sysconfig/nfs-utils



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

* [PATCH 4/6] systemd: remove @localstatedir@ marking.
  2014-02-20  6:55 [nfs-utils/systemd PATCH 0/6] Assorted fixes for systemd units Neil Brown
  2014-02-20  6:55 ` [PATCH 1/6] systemd units: remove reference to nfs-server.target from nfs-server.service Neil Brown
@ 2014-02-20  6:55 ` Neil Brown
  2014-02-20  6:55 ` [PATCH 5/6] systemd: nfs-client needs rpc-svcgssd too Neil Brown
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Neil Brown @ 2014-02-20  6:55 UTC (permalink / raw)
  To: Steve Dickson; +Cc: linux-nfs

This isn't used so currently is inconvenient.
Once we decide how to handle this sort of thing we can apply
the change uniformly.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 systemd/rpc-svcgssd.service |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/systemd/rpc-svcgssd.service b/systemd/rpc-svcgssd.service
index 32b786ec5c7d..f7424b0b1085 100644
--- a/systemd/rpc-svcgssd.service
+++ b/systemd/rpc-svcgssd.service
@@ -6,7 +6,7 @@ PartOf=nfs-server.service
 PartOf=nfs-utils.service
 
 After=gssproxy.service
-ConditionPathExists=|!@localstatedir@/run/gssproxy.pid
+ConditionPathExists=|!/run/gssproxy.pid
 ConditionPathExists=|!/proc/net/rpc/use-gss-proxy
 ConditionPathExists=/etc/krb5.keytab
 



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

* [PATCH 2/6] systemd units: create nfs-config.service as single location to process config.
  2014-02-20  6:55 [nfs-utils/systemd PATCH 0/6] Assorted fixes for systemd units Neil Brown
                   ` (3 preceding siblings ...)
  2014-02-20  6:55 ` [PATCH 6/6] systemd: add PIDFile directives where appropriate Neil Brown
@ 2014-02-20  6:55 ` Neil Brown
  2014-03-22 21:24   ` Steve Dickson
  2014-02-20  6:55 ` [PATCH 3/6] systemd: add nfs-utils_env.sh for SUSE Neil Brown
  2014-03-24 13:37 ` [nfs-utils/systemd PATCH 0/6] Assorted fixes for systemd units Steve Dickson
  6 siblings, 1 reply; 13+ messages in thread
From: Neil Brown @ 2014-02-20  6:55 UTC (permalink / raw)
  To: Steve Dickson; +Cc: linux-nfs

Instead of processing the config information into command lines every
time it might be needed, do it once in a separate service that other
services can Want.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 systemd/README                   |    3 +--
 systemd/nfs-config.service       |    7 +++++++
 systemd/nfs-idmapd.service       |    5 +++--
 systemd/nfs-mountd.service       |    5 +++--
 systemd/nfs-server.service       |    4 +++-
 systemd/rpc-gssd.service         |    4 +++-
 systemd/rpc-statd-notify.service |    5 +++--
 systemd/rpc-statd.service        |    5 +++--
 systemd/rpc-svcgssd.service      |    5 +++--
 9 files changed, 29 insertions(+), 14 deletions(-)
 create mode 100644 systemd/nfs-config.service

diff --git a/systemd/README b/systemd/README
index 8359530098f4..a2a5f0634726 100644
--- a/systemd/README
+++ b/systemd/README
@@ -56,8 +56,7 @@ Distro specific commandline configuration can be provided by
 installing a script /usr/lib/systemd/scripts/nfs-utils_env.sh
 This should write /run/sysconfig/nfs-utils based on configuration
 information such as in /etc/sysconfig/nfs or /etc/defaults/nfs.
-It should write to a tmp file and rename to the target to
-avoid parallel units seeing incomplete copies of the file.
+It is run once by nfs-config.service.
 
 rpc.gssd and rpc.svcgssd are assumed to be needed if /etc/krb5.keytab
 is present.
diff --git a/systemd/nfs-config.service b/systemd/nfs-config.service
new file mode 100644
index 000000000000..4cf2ecc76e4a
--- /dev/null
+++ b/systemd/nfs-config.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Preprocess NFS configuration
+
+[Service]
+type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/lib/systemd/scripts/nfs-utils_env.sh
diff --git a/systemd/nfs-idmapd.service b/systemd/nfs-idmapd.service
index 7d0dd84d8a44..11895e234438 100644
--- a/systemd/nfs-idmapd.service
+++ b/systemd/nfs-idmapd.service
@@ -3,9 +3,10 @@ Description=NFSv4 ID-name mapping service
 
 PartOf=nfs-utils.service
 
+Wants=nfs-config.service
+After=nfs-config.service
+
 [Service]
 EnvironmentFile=-/run/sysconfig/nfs-utils
-ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
-
 Type=forking
 ExecStart=/usr/sbin/rpc.idmapd $RPCIDMAPDARGS
diff --git a/systemd/nfs-mountd.service b/systemd/nfs-mountd.service
index 90746a854b40..7ccc0f72012d 100644
--- a/systemd/nfs-mountd.service
+++ b/systemd/nfs-mountd.service
@@ -6,9 +6,10 @@ After=network.target
 PartOf=nfs-server.service
 PartOf=nfs-utils.service
 
+Wants=nfs-config.service
+After=nfs-config.service
+
 [Service]
 EnvironmentFile=-/run/sysconfig/nfs-utils
-ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
-
 Type=forking
 ExecStart=/usr/sbin/rpc.mountd $RPCMOUNTDARGS
diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
index 5779fd39ed34..2fa7387e1cb9 100644
--- a/systemd/nfs-server.service
+++ b/systemd/nfs-server.service
@@ -10,9 +10,11 @@ After= nfs-idmapd.service rpc-statd.service
 After= rpc-gssd.service rpc-svcgssd.service
 Before= rpc-statd-notify.service
 
+Wants=nfs-config.service
+After=nfs-config.service
+
 [Service]
 EnvironmentFile=-/run/sysconfig/nfs-utils
-ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
 
 Type=oneshot
 RemainAfterExit=yes
diff --git a/systemd/rpc-gssd.service b/systemd/rpc-gssd.service
index 375792804247..d4a381904de4 100644
--- a/systemd/rpc-gssd.service
+++ b/systemd/rpc-gssd.service
@@ -9,9 +9,11 @@ ConditionPathExists=/etc/krb5.keytab
 
 PartOf=nfs-utils.service
 
+Wants=nfs-config.service
+After=nfs-config.service
+
 [Service]
 EnvironmentFile=-/run/sysconfig/nfs-utils
-ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
 
 Type=forking
 ExecStart=/usr/sbin/rpc.gssd $GSSDARGS
diff --git a/systemd/rpc-statd-notify.service b/systemd/rpc-statd-notify.service
index 7742ac8c5d9a..6b13b323e758 100644
--- a/systemd/rpc-statd-notify.service
+++ b/systemd/rpc-statd-notify.service
@@ -9,10 +9,11 @@ After=nfs-server.service
 
 PartOf=nfs-utils.service
 
+Wants=nfs-config.service
+After=nfs-config.service
+
 [Service]
 EnvironmentFile=-/run/sysconfig/nfs-utils
-ExecStartPre=/usr/lib/systemd/scritps/nfs-utils_env.sh
-
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=-/usr/sbin/sm-notify -d $SMNOTIFYARGS
diff --git a/systemd/rpc-statd.service b/systemd/rpc-statd.service
index 3f6cda16accd..c5795fd68f96 100644
--- a/systemd/rpc-statd.service
+++ b/systemd/rpc-statd.service
@@ -7,9 +7,10 @@ After=network.target nss-lookup.target rpcbind.target
 
 PartOf=nfs-utils.service
 
+Wants=nfs-config.service
+After=nfs-config.service
+
 [Service]
 EnvironmentFile=-/run/sysconfig/nfs-utils
-ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
-
 Type=forking
 ExecStart=/usr/sbin/rpc.statd --no-notify $STATDARGS
diff --git a/systemd/rpc-svcgssd.service b/systemd/rpc-svcgssd.service
index 6bd45884d991..32b786ec5c7d 100644
--- a/systemd/rpc-svcgssd.service
+++ b/systemd/rpc-svcgssd.service
@@ -10,9 +10,10 @@ ConditionPathExists=|!@localstatedir@/run/gssproxy.pid
 ConditionPathExists=|!/proc/net/rpc/use-gss-proxy
 ConditionPathExists=/etc/krb5.keytab
 
+Wants=nfs-config.service
+After=nfs-config.service
+
 [Service]
 EnvironmentFile=-/run/sysconfig/nfs-utils
-ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
-
 Type=forking
 ExecStart=/usr/sbin/rpc.svcgssd $SVCGSSDARGS



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

* [PATCH 6/6] systemd: add PIDFile directives where appropriate.
  2014-02-20  6:55 [nfs-utils/systemd PATCH 0/6] Assorted fixes for systemd units Neil Brown
                   ` (2 preceding siblings ...)
  2014-02-20  6:55 ` [PATCH 5/6] systemd: nfs-client needs rpc-svcgssd too Neil Brown
@ 2014-02-20  6:55 ` Neil Brown
  2014-02-20  6:55 ` [PATCH 2/6] systemd units: create nfs-config.service as single location to process config Neil Brown
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Neil Brown @ 2014-02-20  6:55 UTC (permalink / raw)
  To: Steve Dickson; +Cc: linux-nfs

Only two of our daemons write out pid files.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 systemd/nfs-blkmap.service |    1 +
 systemd/rpc-statd.service  |    1 +
 2 files changed, 2 insertions(+)

diff --git a/systemd/nfs-blkmap.service b/systemd/nfs-blkmap.service
index 4b74e9f61454..68cc9e968e65 100644
--- a/systemd/nfs-blkmap.service
+++ b/systemd/nfs-blkmap.service
@@ -12,4 +12,5 @@ PartOf=nfs-utils.service
 
 [Service]
 Type=forking
+PIDFile=/var/run/blkmapd.pid
 ExecStart=/usr/sbin/blkmapd
diff --git a/systemd/rpc-statd.service b/systemd/rpc-statd.service
index c5795fd68f96..14604d783ddf 100644
--- a/systemd/rpc-statd.service
+++ b/systemd/rpc-statd.service
@@ -13,4 +13,5 @@ After=nfs-config.service
 [Service]
 EnvironmentFile=-/run/sysconfig/nfs-utils
 Type=forking
+PIDFile=/var/run/rpc.statd.pid
 ExecStart=/usr/sbin/rpc.statd --no-notify $STATDARGS



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

* [nfs-utils/systemd PATCH 0/6] Assorted fixes for systemd units
@ 2014-02-20  6:55 Neil Brown
  2014-02-20  6:55 ` [PATCH 1/6] systemd units: remove reference to nfs-server.target from nfs-server.service Neil Brown
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Neil Brown @ 2014-02-20  6:55 UTC (permalink / raw)
  To: Steve Dickson; +Cc: linux-nfs

These are a number of ad-hoc things I.  The nfs-utils_env.sh for SUSE
is primarily presented as an example.  I'm happy for it to get
applied, but I'm happy if it isn't applied too.

Thanks,
NeilBrown


---

Neil Brown (6):
      systemd units: remove reference to nfs-server.target from nfs-server.service.
      systemd units: create nfs-config.service as single location to process config.
      systemd: add nfs-utils_env.sh for SUSE.
      systemd: remove @localstatedir@ marking.
      systemd: nfs-client needs rpc-svcgssd too.
      systemd: add PIDFile directives where appropriate.


 systemd/README                   |    3 +-
 systemd/SUSE-nfs-utils_env.sh    |   62 ++++++++++++++++++++++++++++++++++++++
 systemd/nfs-blkmap.service       |    1 +
 systemd/nfs-client.target        |    5 ++-
 systemd/nfs-config.service       |    7 ++++
 systemd/nfs-idmapd.service       |    5 ++-
 systemd/nfs-mountd.service       |    5 ++-
 systemd/nfs-server.service       |    5 ++-
 systemd/rpc-gssd.service         |    4 ++
 systemd/rpc-statd-notify.service |    5 ++-
 systemd/rpc-statd.service        |    6 ++--
 systemd/rpc-svcgssd.service      |    7 ++--
 12 files changed, 97 insertions(+), 18 deletions(-)
 create mode 100644 systemd/SUSE-nfs-utils_env.sh
 create mode 100644 systemd/nfs-config.service

-- 
Signature


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

* [PATCH 5/6] systemd: nfs-client needs rpc-svcgssd too.
  2014-02-20  6:55 [nfs-utils/systemd PATCH 0/6] Assorted fixes for systemd units Neil Brown
  2014-02-20  6:55 ` [PATCH 1/6] systemd units: remove reference to nfs-server.target from nfs-server.service Neil Brown
  2014-02-20  6:55 ` [PATCH 4/6] systemd: remove @localstatedir@ marking Neil Brown
@ 2014-02-20  6:55 ` Neil Brown
  2014-02-20  6:55 ` [PATCH 6/6] systemd: add PIDFile directives where appropriate Neil Brown
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Neil Brown @ 2014-02-20  6:55 UTC (permalink / raw)
  To: Steve Dickson; +Cc: linux-nfs

For NFSv4.0 callbacks, the server needs the client code and
the client needs the server code.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 systemd/nfs-client.target |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/systemd/nfs-client.target b/systemd/nfs-client.target
index fa591354abf3..f3c09e76a0f7 100644
--- a/systemd/nfs-client.target
+++ b/systemd/nfs-client.target
@@ -5,8 +5,9 @@ Wants=remote-fs-pre.target
 
 # Note: we don't "Wants=rpc-statd.service" as "mount.nfs" will arrange to
 # start that on demand if needed.
-Wants=rpc-gssd.service nfs-blkmap.service rpc-statd-notify.service
-Before=rpc-gssd.service nfs-blkmap.service
+Wants=rpc-gssd.service rpc-svcgssd.service
+Wants=nfs-blkmap.service rpc-statd-notify.service
+Before=rpc-gssd.service rpc-svcgssd.service nfs-blkmap.service
 
 [Install]
 WantedBy=multi-user.target



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

* [PATCH 1/6] systemd units: remove reference to nfs-server.target from nfs-server.service.
  2014-02-20  6:55 [nfs-utils/systemd PATCH 0/6] Assorted fixes for systemd units Neil Brown
@ 2014-02-20  6:55 ` Neil Brown
  2014-02-20  6:55 ` [PATCH 4/6] systemd: remove @localstatedir@ marking Neil Brown
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Neil Brown @ 2014-02-20  6:55 UTC (permalink / raw)
  To: Steve Dickson; +Cc: linux-nfs

This  line was somehow missed in a recent patch.  nfs-server.target
doesn't exists, so nothing can be part of it.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 systemd/nfs-server.service |    1 -
 1 file changed, 1 deletion(-)

diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
index 26df65662428..5779fd39ed34 100644
--- a/systemd/nfs-server.service
+++ b/systemd/nfs-server.service
@@ -1,7 +1,6 @@
 [Unit]
 Description=NFS server and services
 Requires= network.target proc-fs-nfsd.mount rpcbind.target
-PartOf=nfs-server.target
 Requires= nfs-mountd.service
 Wants=rpc-statd.service nfs-idmapd.service rpc-gssd.service rpc-svcgssd.service
 Wants=rpc-statd-notify.service



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

* Re: [PATCH 2/6] systemd units: create nfs-config.service as single location to process config.
  2014-02-20  6:55 ` [PATCH 2/6] systemd units: create nfs-config.service as single location to process config Neil Brown
@ 2014-03-22 21:24   ` Steve Dickson
  2014-03-24  0:00     ` NeilBrown
  0 siblings, 1 reply; 13+ messages in thread
From: Steve Dickson @ 2014-03-22 21:24 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-nfs

Hello,

I finally got around to playing with these....
Here is what I found.

On 02/20/2014 01:55 AM, Neil Brown wrote:
> Instead of processing the config information into command lines every
> time it might be needed, do it once in a separate service that other
> services can Want.
> 
> Signed-off-by: NeilBrown <neilb@suse.de>
> ---
>  systemd/README                   |    3 +--
>  systemd/nfs-config.service       |    7 +++++++
>  systemd/nfs-idmapd.service       |    5 +++--
>  systemd/nfs-mountd.service       |    5 +++--
>  systemd/nfs-server.service       |    4 +++-
>  systemd/rpc-gssd.service         |    4 +++-
>  systemd/rpc-statd-notify.service |    5 +++--
>  systemd/rpc-statd.service        |    5 +++--
>  systemd/rpc-svcgssd.service      |    5 +++--
>  9 files changed, 29 insertions(+), 14 deletions(-)
>  create mode 100644 systemd/nfs-config.service
> 
> diff --git a/systemd/README b/systemd/README
> index 8359530098f4..a2a5f0634726 100644
> --- a/systemd/README
> +++ b/systemd/README
> @@ -56,8 +56,7 @@ Distro specific commandline configuration can be provided by
>  installing a script /usr/lib/systemd/scripts/nfs-utils_env.sh
>  This should write /run/sysconfig/nfs-utils based on configuration
>  information such as in /etc/sysconfig/nfs or /etc/defaults/nfs.
> -It should write to a tmp file and rename to the target to
> -avoid parallel units seeing incomplete copies of the file.
> +It is run once by nfs-config.service.
>  
>  rpc.gssd and rpc.svcgssd are assumed to be needed if /etc/krb5.keytab
>  is present.
> diff --git a/systemd/nfs-config.service b/systemd/nfs-config.service
> new file mode 100644
> index 000000000000..4cf2ecc76e4a
> --- /dev/null
> +++ b/systemd/nfs-config.service
> @@ -0,0 +1,7 @@
> +[Unit]
> +Description=Preprocess NFS configuration
> +
> +[Service]
> +type=oneshot
This is a typo... It should be Type=oneshot

> +RemainAfterExit=yes
> +ExecStart=/usr/lib/systemd/scripts/nfs-utils_env.sh
Can this be moved from /usr/lib/systemd/scripts to /usr/lib/systemd/system
since the scripts directory does not exit and I don't think we
want to be creating directories under /usr/lib/systemd/

Finally, Its a bit confusing on how to get the new /run/sysconfig/nfs-utils
created. systemctl start nfs-config does not do it but 
systemctl restart nfs-config. 

Doesn't this also mean every time /etc/sysconfig/nfs is edited
a systemctl restart nfs-config has to be done to update the 
new /run/sysconfig/nfs-utils and then restart the server 
they are reconfigured? Or am I missing something?

If I'm not it seems a bit overly complicated and its not 
appeared to be documented anywhere... 

steved.

> diff --git a/systemd/nfs-idmapd.service b/systemd/nfs-idmapd.service
> index 7d0dd84d8a44..11895e234438 100644
> --- a/systemd/nfs-idmapd.service
> +++ b/systemd/nfs-idmapd.service
> @@ -3,9 +3,10 @@ Description=NFSv4 ID-name mapping service
>  
>  PartOf=nfs-utils.service
>  
> +Wants=nfs-config.service
> +After=nfs-config.service
> +
>  [Service]
>  EnvironmentFile=-/run/sysconfig/nfs-utils
> -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
> -
>  Type=forking
>  ExecStart=/usr/sbin/rpc.idmapd $RPCIDMAPDARGS
> diff --git a/systemd/nfs-mountd.service b/systemd/nfs-mountd.service
> index 90746a854b40..7ccc0f72012d 100644
> --- a/systemd/nfs-mountd.service
> +++ b/systemd/nfs-mountd.service
> @@ -6,9 +6,10 @@ After=network.target
>  PartOf=nfs-server.service
>  PartOf=nfs-utils.service
>  
> +Wants=nfs-config.service
> +After=nfs-config.service
> +
>  [Service]
>  EnvironmentFile=-/run/sysconfig/nfs-utils
> -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
> -
>  Type=forking
>  ExecStart=/usr/sbin/rpc.mountd $RPCMOUNTDARGS
> diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
> index 5779fd39ed34..2fa7387e1cb9 100644
> --- a/systemd/nfs-server.service
> +++ b/systemd/nfs-server.service
> @@ -10,9 +10,11 @@ After= nfs-idmapd.service rpc-statd.service
>  After= rpc-gssd.service rpc-svcgssd.service
>  Before= rpc-statd-notify.service
>  
> +Wants=nfs-config.service
> +After=nfs-config.service
> +
>  [Service]
>  EnvironmentFile=-/run/sysconfig/nfs-utils
> -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
>  
>  Type=oneshot
>  RemainAfterExit=yes
> diff --git a/systemd/rpc-gssd.service b/systemd/rpc-gssd.service
> index 375792804247..d4a381904de4 100644
> --- a/systemd/rpc-gssd.service
> +++ b/systemd/rpc-gssd.service
> @@ -9,9 +9,11 @@ ConditionPathExists=/etc/krb5.keytab
>  
>  PartOf=nfs-utils.service
>  
> +Wants=nfs-config.service
> +After=nfs-config.service
> +
>  [Service]
>  EnvironmentFile=-/run/sysconfig/nfs-utils
> -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
>  
>  Type=forking
>  ExecStart=/usr/sbin/rpc.gssd $GSSDARGS
> diff --git a/systemd/rpc-statd-notify.service b/systemd/rpc-statd-notify.service
> index 7742ac8c5d9a..6b13b323e758 100644
> --- a/systemd/rpc-statd-notify.service
> +++ b/systemd/rpc-statd-notify.service
> @@ -9,10 +9,11 @@ After=nfs-server.service
>  
>  PartOf=nfs-utils.service
>  
> +Wants=nfs-config.service
> +After=nfs-config.service
> +
>  [Service]
>  EnvironmentFile=-/run/sysconfig/nfs-utils
> -ExecStartPre=/usr/lib/systemd/scritps/nfs-utils_env.sh
> -
>  Type=oneshot
>  RemainAfterExit=yes
>  ExecStart=-/usr/sbin/sm-notify -d $SMNOTIFYARGS
> diff --git a/systemd/rpc-statd.service b/systemd/rpc-statd.service
> index 3f6cda16accd..c5795fd68f96 100644
> --- a/systemd/rpc-statd.service
> +++ b/systemd/rpc-statd.service
> @@ -7,9 +7,10 @@ After=network.target nss-lookup.target rpcbind.target
>  
>  PartOf=nfs-utils.service
>  
> +Wants=nfs-config.service
> +After=nfs-config.service
> +
>  [Service]
>  EnvironmentFile=-/run/sysconfig/nfs-utils
> -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
> -
>  Type=forking
>  ExecStart=/usr/sbin/rpc.statd --no-notify $STATDARGS
> diff --git a/systemd/rpc-svcgssd.service b/systemd/rpc-svcgssd.service
> index 6bd45884d991..32b786ec5c7d 100644
> --- a/systemd/rpc-svcgssd.service
> +++ b/systemd/rpc-svcgssd.service
> @@ -10,9 +10,10 @@ ConditionPathExists=|!@localstatedir@/run/gssproxy.pid
>  ConditionPathExists=|!/proc/net/rpc/use-gss-proxy
>  ConditionPathExists=/etc/krb5.keytab
>  
> +Wants=nfs-config.service
> +After=nfs-config.service
> +
>  [Service]
>  EnvironmentFile=-/run/sysconfig/nfs-utils
> -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
> -
>  Type=forking
>  ExecStart=/usr/sbin/rpc.svcgssd $SVCGSSDARGS
> 
> 

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

* Re: [PATCH 3/6] systemd: add nfs-utils_env.sh for SUSE.
  2014-02-20  6:55 ` [PATCH 3/6] systemd: add nfs-utils_env.sh for SUSE Neil Brown
@ 2014-03-23 19:14   ` Steve Dickson
  2014-03-23 23:45     ` NeilBrown
  0 siblings, 1 reply; 13+ messages in thread
From: Steve Dickson @ 2014-03-23 19:14 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-nfs



On 02/20/2014 01:55 AM, Neil Brown wrote:
> This script provides the required translation for
> sysconfig variables understood by init.d script on openSUSE.
> 
> Signed-off-by: NeilBrown <neilb@suse.de>
> ---
>  systemd/SUSE-nfs-utils_env.sh |   62 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 62 insertions(+)
>  create mode 100644 systemd/SUSE-nfs-utils_env.sh
I was thinking about this one too... Yeah, I know.. I need life!! ;-) 

Do we really want distro specific files like this in the upstream repo? 
Its more of a maintenance thing than anything... If something distro 
specific changes, do we really need to send the change upstream and 
does upstream really care? 

steved.  
> 
> diff --git a/systemd/SUSE-nfs-utils_env.sh b/systemd/SUSE-nfs-utils_env.sh
> new file mode 100644
> index 000000000000..8d6d94ed29e5
> --- /dev/null
> +++ b/systemd/SUSE-nfs-utils_env.sh
> @@ -0,0 +1,62 @@
> +#!/bin/sh
> +
> +# extract configuration from /etc/sysconfig/nfs-utils and write
> +# environment to /run/sysconfig/nfs-utils to be used by systemd unit
> +# files.
> +# This script expect configuration as used by openSUSE-13.1 and later
> +#
> +
> +nfs_config=/etc/sysconfig/nfs
> +if test -r $nfs_config; then
> +    . $nfs_config
> +fi
> +
> +pipefs=
> +if [ -n "$RPC_PIPEFS_DIR" -a "$RPC_PIPEFS_DIR" != "/var/lib/nfs/rpc_pipefs" ]; then
> +    pipefs="-p /var/lib/nfs/rpc_pipefs"
> +fi
> +
> +mountdport=
> +if [ -n "$MOUNTD_PORT" ]; then
> +    mountdport="-p $MOUNTD_PORT"
> +fi
> +
> +case $NFS_GSSD_AVOID_DNS in
> +    [Nn]*) ignore_dns=-D ;;
> +    [Yy]*) ignore_dns=   ;;
> +    *    ) ignore_dns=-D
> +esac
> +
> +version_params=
> +if [ "$NFS3_SERVER_SUPPORT" == "no" ]; then
> +   version_params="--no-nfs-version 2 --no-nfs-version 3"
> +fi
> +if [ "$NFS4_SUPPORT" != "yes" ]; then
> +   version_params="--no-nfs-version 4"
> +fi
> +if [ "$NFS4_SERVER_MINOR_VERSION" != "0" ]; then
> +   version_params="$VERSION_PARAMS --nfs-version 4 --nfs-version 4.$NFS4_SERVER_MINOR_VERSION"
> +fi
> +
> +if [ "$USE_KERNEL_NFSD_NUMBER" -gt 0 ]; then
> +    threads=$USE_KERNEL_NFSD_NUMBER
> +else
> +    threads=3
> +fi
> +
> +case $NFS_GSSD_AVOID_DNS in
> +    [Nn]*) ignore_dns=-D ;;
> +    [Yy]*) ignore_dns=   ;;
> +    *    ) ignore_dns=-D
> +esac
> +
> +mkdir -p /run/sysconfig
> +{
> +echo "RPCIDMAPDARGS=$pipefs"
> +echo "RPCMOUNTDARGS=$mountdport $MOUNTD_OPTIONS $version_parms"
> +echo "RPCNFSDARGS=$NFSD_OPTIONS $version_params $threads"
> +echo "GSSDARGS=$ignore_dns $GSSD_OPTIONS $pipefs"
> +echo "SMNOTIFYARGS=$SM_NOTIFY_OPTIONS"
> +echo "STATDARGS=$STATD_OPTIONS"
> +echo "SVCGSSDARGS=$SVCGSSD_OPTIONS"
> +} > /run/sysconfig/nfs-utils
> 
> 

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

* Re: [PATCH 3/6] systemd: add nfs-utils_env.sh for SUSE.
  2014-03-23 19:14   ` Steve Dickson
@ 2014-03-23 23:45     ` NeilBrown
  0 siblings, 0 replies; 13+ messages in thread
From: NeilBrown @ 2014-03-23 23:45 UTC (permalink / raw)
  To: Steve Dickson; +Cc: linux-nfs

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

On Sun, 23 Mar 2014 15:14:44 -0400 Steve Dickson <SteveD@redhat.com> wrote:

> 
> 
> On 02/20/2014 01:55 AM, Neil Brown wrote:
> > This script provides the required translation for
> > sysconfig variables understood by init.d script on openSUSE.
> > 
> > Signed-off-by: NeilBrown <neilb@suse.de>
> > ---
> >  systemd/SUSE-nfs-utils_env.sh |   62 +++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 62 insertions(+)
> >  create mode 100644 systemd/SUSE-nfs-utils_env.sh
> I was thinking about this one too... Yeah, I know.. I need life!! ;-) 
> 
> Do we really want distro specific files like this in the upstream repo? 
> Its more of a maintenance thing than anything... If something distro 
> specific changes, do we really need to send the change upstream and 
> does upstream really care? 

Probably not.  I mainly added that as an example as there seems to be some
confusion over how I imagined these things working.

I'm quite happy to not have  this upstream (I might even prefer it).

Thanks,
NeilBrown


> 
> steved.  
> > 
> > diff --git a/systemd/SUSE-nfs-utils_env.sh b/systemd/SUSE-nfs-utils_env.sh
> > new file mode 100644
> > index 000000000000..8d6d94ed29e5
> > --- /dev/null
> > +++ b/systemd/SUSE-nfs-utils_env.sh
> > @@ -0,0 +1,62 @@
> > +#!/bin/sh
> > +
> > +# extract configuration from /etc/sysconfig/nfs-utils and write
> > +# environment to /run/sysconfig/nfs-utils to be used by systemd unit
> > +# files.
> > +# This script expect configuration as used by openSUSE-13.1 and later
> > +#
> > +
> > +nfs_config=/etc/sysconfig/nfs
> > +if test -r $nfs_config; then
> > +    . $nfs_config
> > +fi
> > +
> > +pipefs=
> > +if [ -n "$RPC_PIPEFS_DIR" -a "$RPC_PIPEFS_DIR" != "/var/lib/nfs/rpc_pipefs" ]; then
> > +    pipefs="-p /var/lib/nfs/rpc_pipefs"
> > +fi
> > +
> > +mountdport=
> > +if [ -n "$MOUNTD_PORT" ]; then
> > +    mountdport="-p $MOUNTD_PORT"
> > +fi
> > +
> > +case $NFS_GSSD_AVOID_DNS in
> > +    [Nn]*) ignore_dns=-D ;;
> > +    [Yy]*) ignore_dns=   ;;
> > +    *    ) ignore_dns=-D
> > +esac
> > +
> > +version_params=
> > +if [ "$NFS3_SERVER_SUPPORT" == "no" ]; then
> > +   version_params="--no-nfs-version 2 --no-nfs-version 3"
> > +fi
> > +if [ "$NFS4_SUPPORT" != "yes" ]; then
> > +   version_params="--no-nfs-version 4"
> > +fi
> > +if [ "$NFS4_SERVER_MINOR_VERSION" != "0" ]; then
> > +   version_params="$VERSION_PARAMS --nfs-version 4 --nfs-version 4.$NFS4_SERVER_MINOR_VERSION"
> > +fi
> > +
> > +if [ "$USE_KERNEL_NFSD_NUMBER" -gt 0 ]; then
> > +    threads=$USE_KERNEL_NFSD_NUMBER
> > +else
> > +    threads=3
> > +fi
> > +
> > +case $NFS_GSSD_AVOID_DNS in
> > +    [Nn]*) ignore_dns=-D ;;
> > +    [Yy]*) ignore_dns=   ;;
> > +    *    ) ignore_dns=-D
> > +esac
> > +
> > +mkdir -p /run/sysconfig
> > +{
> > +echo "RPCIDMAPDARGS=$pipefs"
> > +echo "RPCMOUNTDARGS=$mountdport $MOUNTD_OPTIONS $version_parms"
> > +echo "RPCNFSDARGS=$NFSD_OPTIONS $version_params $threads"
> > +echo "GSSDARGS=$ignore_dns $GSSD_OPTIONS $pipefs"
> > +echo "SMNOTIFYARGS=$SM_NOTIFY_OPTIONS"
> > +echo "STATDARGS=$STATD_OPTIONS"
> > +echo "SVCGSSDARGS=$SVCGSSD_OPTIONS"
> > +} > /run/sysconfig/nfs-utils
> > 
> > 


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

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

* Re: [PATCH 2/6] systemd units: create nfs-config.service as single location to process config.
  2014-03-22 21:24   ` Steve Dickson
@ 2014-03-24  0:00     ` NeilBrown
  2014-03-24 10:45       ` Steve Dickson
  0 siblings, 1 reply; 13+ messages in thread
From: NeilBrown @ 2014-03-24  0:00 UTC (permalink / raw)
  To: Steve Dickson; +Cc: linux-nfs

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

On Sat, 22 Mar 2014 17:24:59 -0400 Steve Dickson <SteveD@redhat.com> wrote:

> Hello,
> 
> I finally got around to playing with these....
> Here is what I found.
> 
> On 02/20/2014 01:55 AM, Neil Brown wrote:
> > Instead of processing the config information into command lines every
> > time it might be needed, do it once in a separate service that other
> > services can Want.
> > 
> > Signed-off-by: NeilBrown <neilb@suse.de>
> > ---
> >  systemd/README                   |    3 +--
> >  systemd/nfs-config.service       |    7 +++++++
> >  systemd/nfs-idmapd.service       |    5 +++--
> >  systemd/nfs-mountd.service       |    5 +++--
> >  systemd/nfs-server.service       |    4 +++-
> >  systemd/rpc-gssd.service         |    4 +++-
> >  systemd/rpc-statd-notify.service |    5 +++--
> >  systemd/rpc-statd.service        |    5 +++--
> >  systemd/rpc-svcgssd.service      |    5 +++--
> >  9 files changed, 29 insertions(+), 14 deletions(-)
> >  create mode 100644 systemd/nfs-config.service
> > 
> > diff --git a/systemd/README b/systemd/README
> > index 8359530098f4..a2a5f0634726 100644
> > --- a/systemd/README
> > +++ b/systemd/README
> > @@ -56,8 +56,7 @@ Distro specific commandline configuration can be provided by
> >  installing a script /usr/lib/systemd/scripts/nfs-utils_env.sh
> >  This should write /run/sysconfig/nfs-utils based on configuration
> >  information such as in /etc/sysconfig/nfs or /etc/defaults/nfs.
> > -It should write to a tmp file and rename to the target to
> > -avoid parallel units seeing incomplete copies of the file.
> > +It is run once by nfs-config.service.
> >  
> >  rpc.gssd and rpc.svcgssd are assumed to be needed if /etc/krb5.keytab
> >  is present.
> > diff --git a/systemd/nfs-config.service b/systemd/nfs-config.service
> > new file mode 100644
> > index 000000000000..4cf2ecc76e4a
> > --- /dev/null
> > +++ b/systemd/nfs-config.service
> > @@ -0,0 +1,7 @@
> > +[Unit]
> > +Description=Preprocess NFS configuration
> > +
> > +[Service]
> > +type=oneshot
> This is a typo... It should be Type=oneshot

Groan.  Thanks.


> 
> > +RemainAfterExit=yes
> > +ExecStart=/usr/lib/systemd/scripts/nfs-utils_env.sh
> Can this be moved from /usr/lib/systemd/scripts to /usr/lib/systemd/system
> since the scripts directory does not exit and I don't think we
> want to be creating directories under /usr/lib/systemd/

Interesting question.
I don't think it really belongs in /usr/lib/systemd/system, though as it has
a ".sh" extension systemd isn't going to confuse it for a unit file.
However systemd developers seem to have the attitude to just "do it right,
even if that means doing something new", and I think a scripts directory is
"right", even though it is currently "new".

Though it isn't that new - a google for
   "/usr/lib/systemd/scripts"
(in quotes) claim 44000 hits, and those that I looked at are genuine (though
probably not all really unique).

If we agree that having shell scripts is appropriate we should probably raise
the preferred location on the systemd-devel mailing list.


> 
> Finally, Its a bit confusing on how to get the new /run/sysconfig/nfs-utils
> created. systemctl start nfs-config does not do it but 
> systemctl restart nfs-config. 
> 
> Doesn't this also mean every time /etc/sysconfig/nfs is edited
> a systemctl restart nfs-config has to be done to update the 
> new /run/sysconfig/nfs-utils and then restart the server 
> they are reconfigured? Or am I missing something?

Fair comment.... Maybe we should use a 'path' unit to run the config-parser
every time /etc/sysconfig/nfs changes.
I'll see if I can make that work.

Thanks,
NeilBrown





> 
> If I'm not it seems a bit overly complicated and its not 
> appeared to be documented anywhere... 
> 
> steved.
> 
> > diff --git a/systemd/nfs-idmapd.service b/systemd/nfs-idmapd.service
> > index 7d0dd84d8a44..11895e234438 100644
> > --- a/systemd/nfs-idmapd.service
> > +++ b/systemd/nfs-idmapd.service
> > @@ -3,9 +3,10 @@ Description=NFSv4 ID-name mapping service
> >  
> >  PartOf=nfs-utils.service
> >  
> > +Wants=nfs-config.service
> > +After=nfs-config.service
> > +
> >  [Service]
> >  EnvironmentFile=-/run/sysconfig/nfs-utils
> > -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
> > -
> >  Type=forking
> >  ExecStart=/usr/sbin/rpc.idmapd $RPCIDMAPDARGS
> > diff --git a/systemd/nfs-mountd.service b/systemd/nfs-mountd.service
> > index 90746a854b40..7ccc0f72012d 100644
> > --- a/systemd/nfs-mountd.service
> > +++ b/systemd/nfs-mountd.service
> > @@ -6,9 +6,10 @@ After=network.target
> >  PartOf=nfs-server.service
> >  PartOf=nfs-utils.service
> >  
> > +Wants=nfs-config.service
> > +After=nfs-config.service
> > +
> >  [Service]
> >  EnvironmentFile=-/run/sysconfig/nfs-utils
> > -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
> > -
> >  Type=forking
> >  ExecStart=/usr/sbin/rpc.mountd $RPCMOUNTDARGS
> > diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
> > index 5779fd39ed34..2fa7387e1cb9 100644
> > --- a/systemd/nfs-server.service
> > +++ b/systemd/nfs-server.service
> > @@ -10,9 +10,11 @@ After= nfs-idmapd.service rpc-statd.service
> >  After= rpc-gssd.service rpc-svcgssd.service
> >  Before= rpc-statd-notify.service
> >  
> > +Wants=nfs-config.service
> > +After=nfs-config.service
> > +
> >  [Service]
> >  EnvironmentFile=-/run/sysconfig/nfs-utils
> > -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
> >  
> >  Type=oneshot
> >  RemainAfterExit=yes
> > diff --git a/systemd/rpc-gssd.service b/systemd/rpc-gssd.service
> > index 375792804247..d4a381904de4 100644
> > --- a/systemd/rpc-gssd.service
> > +++ b/systemd/rpc-gssd.service
> > @@ -9,9 +9,11 @@ ConditionPathExists=/etc/krb5.keytab
> >  
> >  PartOf=nfs-utils.service
> >  
> > +Wants=nfs-config.service
> > +After=nfs-config.service
> > +
> >  [Service]
> >  EnvironmentFile=-/run/sysconfig/nfs-utils
> > -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
> >  
> >  Type=forking
> >  ExecStart=/usr/sbin/rpc.gssd $GSSDARGS
> > diff --git a/systemd/rpc-statd-notify.service b/systemd/rpc-statd-notify.service
> > index 7742ac8c5d9a..6b13b323e758 100644
> > --- a/systemd/rpc-statd-notify.service
> > +++ b/systemd/rpc-statd-notify.service
> > @@ -9,10 +9,11 @@ After=nfs-server.service
> >  
> >  PartOf=nfs-utils.service
> >  
> > +Wants=nfs-config.service
> > +After=nfs-config.service
> > +
> >  [Service]
> >  EnvironmentFile=-/run/sysconfig/nfs-utils
> > -ExecStartPre=/usr/lib/systemd/scritps/nfs-utils_env.sh
> > -
> >  Type=oneshot
> >  RemainAfterExit=yes
> >  ExecStart=-/usr/sbin/sm-notify -d $SMNOTIFYARGS
> > diff --git a/systemd/rpc-statd.service b/systemd/rpc-statd.service
> > index 3f6cda16accd..c5795fd68f96 100644
> > --- a/systemd/rpc-statd.service
> > +++ b/systemd/rpc-statd.service
> > @@ -7,9 +7,10 @@ After=network.target nss-lookup.target rpcbind.target
> >  
> >  PartOf=nfs-utils.service
> >  
> > +Wants=nfs-config.service
> > +After=nfs-config.service
> > +
> >  [Service]
> >  EnvironmentFile=-/run/sysconfig/nfs-utils
> > -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
> > -
> >  Type=forking
> >  ExecStart=/usr/sbin/rpc.statd --no-notify $STATDARGS
> > diff --git a/systemd/rpc-svcgssd.service b/systemd/rpc-svcgssd.service
> > index 6bd45884d991..32b786ec5c7d 100644
> > --- a/systemd/rpc-svcgssd.service
> > +++ b/systemd/rpc-svcgssd.service
> > @@ -10,9 +10,10 @@ ConditionPathExists=|!@localstatedir@/run/gssproxy.pid
> >  ConditionPathExists=|!/proc/net/rpc/use-gss-proxy
> >  ConditionPathExists=/etc/krb5.keytab
> >  
> > +Wants=nfs-config.service
> > +After=nfs-config.service
> > +
> >  [Service]
> >  EnvironmentFile=-/run/sysconfig/nfs-utils
> > -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
> > -
> >  Type=forking
> >  ExecStart=/usr/sbin/rpc.svcgssd $SVCGSSDARGS
> > 
> > 


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

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

* Re: [PATCH 2/6] systemd units: create nfs-config.service as single location to process config.
  2014-03-24  0:00     ` NeilBrown
@ 2014-03-24 10:45       ` Steve Dickson
  0 siblings, 0 replies; 13+ messages in thread
From: Steve Dickson @ 2014-03-24 10:45 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-nfs



On 03/23/2014 08:00 PM, NeilBrown wrote:
> On Sat, 22 Mar 2014 17:24:59 -0400 Steve Dickson <SteveD@redhat.com> wrote:
> 
>> Hello,
>>
>> I finally got around to playing with these....
>> Here is what I found.
>>
>> On 02/20/2014 01:55 AM, Neil Brown wrote:
>>> Instead of processing the config information into command lines every
>>> time it might be needed, do it once in a separate service that other
>>> services can Want.
>>>
>>> Signed-off-by: NeilBrown <neilb@suse.de>
>>> ---
>>>  systemd/README                   |    3 +--
>>>  systemd/nfs-config.service       |    7 +++++++
>>>  systemd/nfs-idmapd.service       |    5 +++--
>>>  systemd/nfs-mountd.service       |    5 +++--
>>>  systemd/nfs-server.service       |    4 +++-
>>>  systemd/rpc-gssd.service         |    4 +++-
>>>  systemd/rpc-statd-notify.service |    5 +++--
>>>  systemd/rpc-statd.service        |    5 +++--
>>>  systemd/rpc-svcgssd.service      |    5 +++--
>>>  9 files changed, 29 insertions(+), 14 deletions(-)
>>>  create mode 100644 systemd/nfs-config.service
>>>
>>> diff --git a/systemd/README b/systemd/README
>>> index 8359530098f4..a2a5f0634726 100644
>>> --- a/systemd/README
>>> +++ b/systemd/README
>>> @@ -56,8 +56,7 @@ Distro specific commandline configuration can be provided by
>>>  installing a script /usr/lib/systemd/scripts/nfs-utils_env.sh
>>>  This should write /run/sysconfig/nfs-utils based on configuration
>>>  information such as in /etc/sysconfig/nfs or /etc/defaults/nfs.
>>> -It should write to a tmp file and rename to the target to
>>> -avoid parallel units seeing incomplete copies of the file.
>>> +It is run once by nfs-config.service.
>>>  
>>>  rpc.gssd and rpc.svcgssd are assumed to be needed if /etc/krb5.keytab
>>>  is present.
>>> diff --git a/systemd/nfs-config.service b/systemd/nfs-config.service
>>> new file mode 100644
>>> index 000000000000..4cf2ecc76e4a
>>> --- /dev/null
>>> +++ b/systemd/nfs-config.service
>>> @@ -0,0 +1,7 @@
>>> +[Unit]
>>> +Description=Preprocess NFS configuration
>>> +
>>> +[Service]
>>> +type=oneshot
>> This is a typo... It should be Type=oneshot
> 
> Groan.  Thanks.
> 
> 
>>
>>> +RemainAfterExit=yes
>>> +ExecStart=/usr/lib/systemd/scripts/nfs-utils_env.sh
>> Can this be moved from /usr/lib/systemd/scripts to /usr/lib/systemd/system
>> since the scripts directory does not exit and I don't think we
>> want to be creating directories under /usr/lib/systemd/
> 
> Interesting question.
> I don't think it really belongs in /usr/lib/systemd/system, though as it has
> a ".sh" extension systemd isn't going to confuse it for a unit file.
> However systemd developers seem to have the attitude to just "do it right,
> even if that means doing something new", and I think a scripts directory is
> "right", even though it is currently "new".
> 
> Though it isn't that new - a google for
>    "/usr/lib/systemd/scripts"
> (in quotes) claim 44000 hits, and those that I looked at are genuine (though
> probably not all really unique).
I got 44300... ;-) 

> 
> If we agree that having shell scripts is appropriate we should probably raise
> the preferred location on the systemd-devel mailing list.
I was just concern with creating the directory... but it appears to be
the right ting to do... 

> 
> 
>>
>> Finally, Its a bit confusing on how to get the new /run/sysconfig/nfs-utils
>> created. systemctl start nfs-config does not do it but 
>> systemctl restart nfs-config. 
>>
>> Doesn't this also mean every time /etc/sysconfig/nfs is edited
>> a systemctl restart nfs-config has to be done to update the 
>> new /run/sysconfig/nfs-utils and then restart the server 
>> they are reconfigured? Or am I missing something?
> 
> Fair comment.... Maybe we should use a 'path' unit to run the config-parser
> every time /etc/sysconfig/nfs changes.
> I'll see if I can make that work.
That would be good... thanks!

steved.
> 
> Thanks,
> NeilBrown
> 
> 
> 
> 
> 
>>
>> If I'm not it seems a bit overly complicated and its not 
>> appeared to be documented anywhere... 
>>
>> steved.
>>
>>> diff --git a/systemd/nfs-idmapd.service b/systemd/nfs-idmapd.service
>>> index 7d0dd84d8a44..11895e234438 100644
>>> --- a/systemd/nfs-idmapd.service
>>> +++ b/systemd/nfs-idmapd.service
>>> @@ -3,9 +3,10 @@ Description=NFSv4 ID-name mapping service
>>>  
>>>  PartOf=nfs-utils.service
>>>  
>>> +Wants=nfs-config.service
>>> +After=nfs-config.service
>>> +
>>>  [Service]
>>>  EnvironmentFile=-/run/sysconfig/nfs-utils
>>> -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
>>> -
>>>  Type=forking
>>>  ExecStart=/usr/sbin/rpc.idmapd $RPCIDMAPDARGS
>>> diff --git a/systemd/nfs-mountd.service b/systemd/nfs-mountd.service
>>> index 90746a854b40..7ccc0f72012d 100644
>>> --- a/systemd/nfs-mountd.service
>>> +++ b/systemd/nfs-mountd.service
>>> @@ -6,9 +6,10 @@ After=network.target
>>>  PartOf=nfs-server.service
>>>  PartOf=nfs-utils.service
>>>  
>>> +Wants=nfs-config.service
>>> +After=nfs-config.service
>>> +
>>>  [Service]
>>>  EnvironmentFile=-/run/sysconfig/nfs-utils
>>> -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
>>> -
>>>  Type=forking
>>>  ExecStart=/usr/sbin/rpc.mountd $RPCMOUNTDARGS
>>> diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
>>> index 5779fd39ed34..2fa7387e1cb9 100644
>>> --- a/systemd/nfs-server.service
>>> +++ b/systemd/nfs-server.service
>>> @@ -10,9 +10,11 @@ After= nfs-idmapd.service rpc-statd.service
>>>  After= rpc-gssd.service rpc-svcgssd.service
>>>  Before= rpc-statd-notify.service
>>>  
>>> +Wants=nfs-config.service
>>> +After=nfs-config.service
>>> +
>>>  [Service]
>>>  EnvironmentFile=-/run/sysconfig/nfs-utils
>>> -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
>>>  
>>>  Type=oneshot
>>>  RemainAfterExit=yes
>>> diff --git a/systemd/rpc-gssd.service b/systemd/rpc-gssd.service
>>> index 375792804247..d4a381904de4 100644
>>> --- a/systemd/rpc-gssd.service
>>> +++ b/systemd/rpc-gssd.service
>>> @@ -9,9 +9,11 @@ ConditionPathExists=/etc/krb5.keytab
>>>  
>>>  PartOf=nfs-utils.service
>>>  
>>> +Wants=nfs-config.service
>>> +After=nfs-config.service
>>> +
>>>  [Service]
>>>  EnvironmentFile=-/run/sysconfig/nfs-utils
>>> -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
>>>  
>>>  Type=forking
>>>  ExecStart=/usr/sbin/rpc.gssd $GSSDARGS
>>> diff --git a/systemd/rpc-statd-notify.service b/systemd/rpc-statd-notify.service
>>> index 7742ac8c5d9a..6b13b323e758 100644
>>> --- a/systemd/rpc-statd-notify.service
>>> +++ b/systemd/rpc-statd-notify.service
>>> @@ -9,10 +9,11 @@ After=nfs-server.service
>>>  
>>>  PartOf=nfs-utils.service
>>>  
>>> +Wants=nfs-config.service
>>> +After=nfs-config.service
>>> +
>>>  [Service]
>>>  EnvironmentFile=-/run/sysconfig/nfs-utils
>>> -ExecStartPre=/usr/lib/systemd/scritps/nfs-utils_env.sh
>>> -
>>>  Type=oneshot
>>>  RemainAfterExit=yes
>>>  ExecStart=-/usr/sbin/sm-notify -d $SMNOTIFYARGS
>>> diff --git a/systemd/rpc-statd.service b/systemd/rpc-statd.service
>>> index 3f6cda16accd..c5795fd68f96 100644
>>> --- a/systemd/rpc-statd.service
>>> +++ b/systemd/rpc-statd.service
>>> @@ -7,9 +7,10 @@ After=network.target nss-lookup.target rpcbind.target
>>>  
>>>  PartOf=nfs-utils.service
>>>  
>>> +Wants=nfs-config.service
>>> +After=nfs-config.service
>>> +
>>>  [Service]
>>>  EnvironmentFile=-/run/sysconfig/nfs-utils
>>> -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
>>> -
>>>  Type=forking
>>>  ExecStart=/usr/sbin/rpc.statd --no-notify $STATDARGS
>>> diff --git a/systemd/rpc-svcgssd.service b/systemd/rpc-svcgssd.service
>>> index 6bd45884d991..32b786ec5c7d 100644
>>> --- a/systemd/rpc-svcgssd.service
>>> +++ b/systemd/rpc-svcgssd.service
>>> @@ -10,9 +10,10 @@ ConditionPathExists=|!@localstatedir@/run/gssproxy.pid
>>>  ConditionPathExists=|!/proc/net/rpc/use-gss-proxy
>>>  ConditionPathExists=/etc/krb5.keytab
>>>  
>>> +Wants=nfs-config.service
>>> +After=nfs-config.service
>>> +
>>>  [Service]
>>>  EnvironmentFile=-/run/sysconfig/nfs-utils
>>> -ExecStartPre=-/usr/lib/systemd/scritps/nfs-utils_env.sh
>>> -
>>>  Type=forking
>>>  ExecStart=/usr/sbin/rpc.svcgssd $SVCGSSDARGS
>>>
>>>
> 

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

* Re: [nfs-utils/systemd PATCH 0/6] Assorted fixes for systemd units
  2014-02-20  6:55 [nfs-utils/systemd PATCH 0/6] Assorted fixes for systemd units Neil Brown
                   ` (5 preceding siblings ...)
  2014-02-20  6:55 ` [PATCH 3/6] systemd: add nfs-utils_env.sh for SUSE Neil Brown
@ 2014-03-24 13:37 ` Steve Dickson
  6 siblings, 0 replies; 13+ messages in thread
From: Steve Dickson @ 2014-03-24 13:37 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-nfs



On 02/20/2014 01:55 AM, Neil Brown wrote:
> These are a number of ad-hoc things I.  The nfs-utils_env.sh for SUSE
> is primarily presented as an example.  I'm happy for it to get
> applied, but I'm happy if it isn't applied too.
> 
> Thanks,
> NeilBrown
> 
> 
> ---
> 
> Neil Brown (6):
>       systemd units: remove reference to nfs-server.target from nfs-server.service.
>       systemd units: create nfs-config.service as single location to process config.
Committed to both of test to the systemd branch, with typo fixed.
>       systemd: add nfs-utils_env.sh for SUSE.
Did not commit this one. 

>       systemd: remove @localstatedir@ marking.
>       systemd: nfs-client needs rpc-svcgssd too.
>       systemd: add PIDFile directives where appropriate.
Committed these three to the systemd branch.

I'm planning on move these on the main branch very soon
they will be in the upcoming release.

steved.

> 
> 
>  systemd/README                   |    3 +-
>  systemd/SUSE-nfs-utils_env.sh    |   62 ++++++++++++++++++++++++++++++++++++++
>  systemd/nfs-blkmap.service       |    1 +
>  systemd/nfs-client.target        |    5 ++-
>  systemd/nfs-config.service       |    7 ++++
>  systemd/nfs-idmapd.service       |    5 ++-
>  systemd/nfs-mountd.service       |    5 ++-
>  systemd/nfs-server.service       |    5 ++-
>  systemd/rpc-gssd.service         |    4 ++
>  systemd/rpc-statd-notify.service |    5 ++-
>  systemd/rpc-statd.service        |    6 ++--
>  systemd/rpc-svcgssd.service      |    7 ++--
>  12 files changed, 97 insertions(+), 18 deletions(-)
>  create mode 100644 systemd/SUSE-nfs-utils_env.sh
>  create mode 100644 systemd/nfs-config.service
> 

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

end of thread, other threads:[~2014-03-24 13:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-20  6:55 [nfs-utils/systemd PATCH 0/6] Assorted fixes for systemd units Neil Brown
2014-02-20  6:55 ` [PATCH 1/6] systemd units: remove reference to nfs-server.target from nfs-server.service Neil Brown
2014-02-20  6:55 ` [PATCH 4/6] systemd: remove @localstatedir@ marking Neil Brown
2014-02-20  6:55 ` [PATCH 5/6] systemd: nfs-client needs rpc-svcgssd too Neil Brown
2014-02-20  6:55 ` [PATCH 6/6] systemd: add PIDFile directives where appropriate Neil Brown
2014-02-20  6:55 ` [PATCH 2/6] systemd units: create nfs-config.service as single location to process config Neil Brown
2014-03-22 21:24   ` Steve Dickson
2014-03-24  0:00     ` NeilBrown
2014-03-24 10:45       ` Steve Dickson
2014-02-20  6:55 ` [PATCH 3/6] systemd: add nfs-utils_env.sh for SUSE Neil Brown
2014-03-23 19:14   ` Steve Dickson
2014-03-23 23:45     ` NeilBrown
2014-03-24 13:37 ` [nfs-utils/systemd PATCH 0/6] Assorted fixes for systemd units Steve Dickson

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.