Assorted fixes for systemd units
Subsystems (2)
cover Assorted fixes for systemd units
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 · 1 line
Signature
PATCH 1/6 systemd units: remove reference to nfs-server.target from nfs-server.service.
This line was somehow missed in a recent patch. nfs-server.target doesn't exists, so nothing can be part of it.
--- systemd/nfs-server.service | 1 - 1 file changed, 1 deletion(-)
systemd/nfs-server.service +0 -1
@@ -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
PATCH 2/6 systemd units: create nfs-config.service as single location to process config.
In reply to Neil BrownInstead 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.
--- 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
systemd/README +1 -2
@@ -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.
systemd/nfs-config.service new file +7 -0
@@ -0,0 +1,7 @@ +[Unit] +Description=Preprocess NFS configuration + +[Service] +type=oneshot +RemainAfterExit=yes +ExecStart=/usr/lib/systemd/scripts/nfs-utils_env.sh
systemd/nfs-idmapd.service +3 -2
@@ -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
systemd/nfs-mountd.service +3 -2
@@ -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
systemd/nfs-server.service +3 -1
@@ -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
systemd/rpc-gssd.service +3 -1
@@ -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
systemd/rpc-statd-notify.service +3 -2
@@ -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
systemd/rpc-statd.service +3 -2
@@ -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
systemd/rpc-svcgssd.service +3 -2
@@ -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
Re: [PATCH 2/6] systemd units: create nfs-config.service as single location to process config.
Hello,
I finally got around to playing with these....
Here is what I found.
Quoted 38 lines · Neil Brown
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 <[email protected]>--- 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.servicesystemd/README +1
-2@@ -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.systemd/nfs-config.service new file +0
-0
systemd/nfs-config.service line 5
Quoted 5 lines
systemd/nfs-config.service new file +5
-0@@ -0,0 +1,7 @@ +[Unit] +Description=Preprocess NFS configuration + +[Service] +type=oneshot
This is a typo... It should be Type=oneshot
systemd/nfs-config.service line 7
Quoted 2 lines
systemd/nfs-config.service new file +2
-0+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.
Quoted 122 lines
systemd/nfs-idmapd.service +3
-2@@ -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 $RPCIDMAPDARGSsystemd/nfs-mountd.service +3
-2@@ -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 $RPCMOUNTDARGSsystemd/nfs-server.service +3
-1@@ -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=yessystemd/rpc-gssd.service +3
-1@@ -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 $GSSDARGSsystemd/rpc-statd-notify.service +3
-2@@ -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 $SMNOTIFYARGSsystemd/rpc-statd.service +3
-2@@ -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 $STATDARGSsystemd/rpc-svcgssd.service +3
-2@@ -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
Re: [PATCH 2/6] systemd units: create nfs-config.service as single location to process config.
Quoted 36 lines · On Sat, 22 Mar 2014 17:24:59 -0400 Steve Dickson <[email protected]> wrote:
Hello,
I finally got around to playing with these....
Here is what I found.Quoted 30 lines · Neil Brown
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 <[email protected]>--- 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.servicesystemd/README +1
-2@@ -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.
Quoted 14 lines
systemd/nfs-config.service line 5
Quoted 13 lines
systemd/README +0
-0rpc.gssd and rpc.svcgssd are assumed to be needed if /etc/krb5.keytab is present.systemd/nfs-config.service new file +5
-0@@ -0,0 +1,7 @@ +[Unit] +Description=Preprocess NFS configuration + +[Service] +type=oneshotThis is a typo... It should be Type=oneshot
Groan. Thanks.
Quoted 6 lines
systemd/nfs-config.service line 7
Quoted 3 lines
systemd/nfs-config.service new file +2
-0+RemainAfterExit=yes +ExecStart=/usr/lib/systemd/scripts/nfs-utils_env.shCan this be moved from
/usr/lib/systemd/scriptsto/usr/lib/systemd/systemsince 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.
Quoted 9 lines
Finally, Its a bit confusing on how to get the new
/run/sysconfig/nfs-utilscreated. systemctl start nfs-config does not do it but systemctl restart nfs-config.Doesn't this also mean every time
/etc/sysconfig/nfsis edited a systemctl restart nfs-config has to be done to update the new/run/sysconfig/nfs-utilsand 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
Quoted 128 lines
If I'm not it seems a bit overly complicated and its not appeared to be documented anywhere...
steved.
Quoted 122 lines
systemd/nfs-idmapd.service +3
-2@@ -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 $RPCIDMAPDARGSsystemd/nfs-mountd.service +3
-2@@ -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 $RPCMOUNTDARGSsystemd/nfs-server.service +3
-1@@ -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=yessystemd/rpc-gssd.service +3
-1@@ -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 $GSSDARGSsystemd/rpc-statd-notify.service +3
-2@@ -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 $SMNOTIFYARGSsystemd/rpc-statd.service +3
-2@@ -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 $STATDARGSsystemd/rpc-svcgssd.service +3
-2@@ -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
Re: [PATCH 2/6] systemd units: create nfs-config.service as single location to process config.
Quoted 70 lines · NeilBrown
Quoted 36 lines · On Sat, 22 Mar 2014 17:24:59 -0400 Steve Dickson <[email protected]> wrote:
Hello,
I finally got around to playing with these....
Here is what I found.Quoted 30 lines · Neil Brown
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 <[email protected]>--- 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.servicesystemd/README +1
-2@@ -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.Quoted 14 lines
systemd/nfs-config.service line 5
Quoted 13 lines
systemd/README +0
-0rpc.gssd and rpc.svcgssd are assumed to be needed if /etc/krb5.keytab is present.systemd/nfs-config.service new file +5
-0@@ -0,0 +1,7 @@ +[Unit] +Description=Preprocess NFS configuration + +[Service] +type=oneshotThis is a typo... It should be Type=oneshot
Groan. Thanks.
Quoted 6 lines
systemd/nfs-config.service line 7
Quoted 3 lines
systemd/nfs-config.service new file +2
-0+RemainAfterExit=yes +ExecStart=/usr/lib/systemd/scripts/nfs-utils_env.shCan this be moved from
/usr/lib/systemd/scriptsto/usr/lib/systemd/systemsince 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".
Quoted 4 lines
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... ;-)
Quoted 3 lines
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...
Quoted 7 lines
Quoted 7 lines
Finally, Its a bit confusing on how to get the new
/run/sysconfig/nfs-utilscreated. systemctl start nfs-config does not do it but systemctl restart nfs-config.
Quoted 8 lines
Quoted 4 lines
Doesn't this also mean every time
/etc/sysconfig/nfsis edited a systemctl restart nfs-config has to be done to update the new/run/sysconfig/nfs-utilsand 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/nfschanges.
I'll see if I can make that work.
That would be good... thanks!
steved.
Quoted 137 lines
Thanks,
NeilBrownQuoted 128 lines
If I'm not it seems a bit overly complicated and its not appeared to be documented anywhere...
steved.
Quoted 122 lines
systemd/nfs-idmapd.service +3
-2@@ -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 $RPCIDMAPDARGSsystemd/nfs-mountd.service +3
-2@@ -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 $RPCMOUNTDARGSsystemd/nfs-server.service +3
-1@@ -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=yessystemd/rpc-gssd.service +3
-1@@ -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 $GSSDARGSsystemd/rpc-statd-notify.service +3
-2@@ -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 $SMNOTIFYARGSsystemd/rpc-statd.service +3
-2@@ -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 $STATDARGSsystemd/rpc-svcgssd.service +3
-2@@ -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
PATCH 3/6 systemd: add nfs-utils_env.sh for SUSE.
In reply to Neil BrownThis script provides the required translation for sysconfig variables understood by init.d script on openSUSE.
--- systemd/SUSE-nfs-utils_env.sh | 62 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 systemd/SUSE-nfs-utils_env.sh
systemd/SUSE-nfs-utils_env.sh new file +62 -0
@@ -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
Re: [PATCH 3/6] systemd: add nfs-utils_env.sh for SUSE.
Quoted 8 lines · Neil Brown
This script provides the required translation for sysconfig variables understood by init.d script on openSUSE.
Signed-off-by NeilBrown <[email protected]>--- 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.
Quoted 71 lines
systemd/SUSE-nfs-utils_env.sh new file +62
-0@@ -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
Re: [PATCH 3/6] systemd: add nfs-utils_env.sh for SUSE.
Quoted 11 lines · On Sun, 23 Mar 2014 15:14:44 -0400 Steve Dickson <[email protected]> wrote:
Quoted 8 lines · Neil Brown
This script provides the required translation for sysconfig variables understood by init.d script on openSUSE.
Signed-off-by NeilBrown <[email protected]>--- systemd/SUSE-nfs-utils_env.sh | 62 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 systemd/SUSE-nfs-utils_env.sh
Quoted 6 lines
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
Quoted 73 lines
steved.
Quoted 71 lines
systemd/SUSE-nfs-utils_env.sh new file +62
-0@@ -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
PATCH 4/6 systemd: remove @localstatedir@ marking.
In reply to Neil BrownThis isn't used so currently is inconvenient.
Once we decide how to handle this sort of thing we can apply the change uniformly.
--- systemd/rpc-svcgssd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
systemd/rpc-svcgssd.service +1 -1
@@ -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
PATCH 5/6 systemd: nfs-client needs rpc-svcgssd too.
In reply to Neil BrownFor NFSv4.0 callbacks, the server needs the client code and the client needs the server code.
--- systemd/nfs-client.target | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
systemd/nfs-client.target +3 -2
@@ -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
PATCH 6/6 systemd: add PIDFile directives where appropriate.
In reply to Neil BrownOnly two of our daemons write out pid files.
--- systemd/nfs-blkmap.service | 1 + systemd/rpc-statd.service | 1 + 2 files changed, 2 insertions(+)
systemd/nfs-blkmap.service +1 -0
@@ -12,4 +12,5 @@ PartOf=nfs-utils.service [Service] Type=forking +PIDFile=/var/run/blkmapd.pid ExecStart=/usr/sbin/blkmapd
systemd/rpc-statd.service +1 -0
@@ -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
Quoted 8 lines · Neil Brown
These are a number of ad-hoc things I. The
nfs-utils_env.shfor 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
Quoted 5 lines
---
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.
Quoted 1 line
systemd: add
nfs-utils_env.shfor SUSE.
Did not commit this one.
Quoted 3 lines
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.
Quoted 18 lines
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