Skip to contentSkip to conversation

Miscellaneous systemd changes

PATCH In review Steve Dickson 3 participants 7 messages Jan 13, 2015 – Jan 15, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Miscellaneous systemd changes

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(-)
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/3 systemd: Bind rpc.idmapd to the nfs-server service

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.

---
 systemd/nfs-idmapd.service | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
systemd/nfs-idmapd.service +1 -1
index 11895e2..61c9a64 100644
@@ -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
Signature · 1 line
2.1.0
#2 lore raw

Re: [systemd-devel] [PATCH 1/3] systemd: Bind rpc.idmapd to the nfs-server service

Quoted 15 lines · Steve Dickson

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.

---
 systemd/nfs-idmapd.service | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
systemd/nfs-idmapd.service +0 -0
index 11895e2..61c9a64 100644

systemd/nfs-idmapd.service line 4

Quoted 5 lines
systemd/nfs-idmapd.service +1 -1
@@ -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

Quoted 10 lines
systemd/nfs-idmapd.service +0 -0
 Wants=nfs-config.service
 After=nfs-config.service
Signature · 6 lines
2.1.0

_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel
#3 lore raw

Re: [systemd-devel] [PATCH 1/3] systemd: Bind rpc.idmapd to the nfs-server service

Quoted 19 lines · Michal Sekletar
Quoted 18 lines · Steve Dickson

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.

---
 systemd/nfs-idmapd.service | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
systemd/nfs-idmapd.service +0 -0
index 11895e2..61c9a64 100644
@@ -1,7 +1,7 @@
 [Unit]
 Description=NFSv4 ID-name mapping service
 
Quoted 4 lines

systemd/nfs-idmapd.service line 4

Quoted 2 lines
systemd/nfs-idmapd.service +1 -1
-PartOf=nfs-utils.service
+BindTo=nfs-server.service

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

Got it.. Thanks!

steved.

Quoted 13 lines

Michal

Quoted 10 lines
systemd/nfs-idmapd.service +0 -0
 Wants=nfs-config.service
 After=nfs-config.service
Signature · 6 lines
2.1.0

_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel
#4 lore raw

PATCH 2/3 systemd: Bind the nfs-mountd service to the nfs-server service

In reply to Steve Dickson

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

---
 systemd/nfs-mountd.service | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
systemd/nfs-mountd.service +1 -2
index 7ccc0f7..c16af57 100644
@@ -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
Signature · 1 line
2.1.0
#5 lore raw

PATCH 3/3 start-statd: Use the canonical to check if systemd is running.

In reply to Steve Dickson

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

to check if systemd is installed and running

---
 utils/statd/start-statd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
utils/statd/start-statd +1 -1
index ec9383b..b32b3a5 100755
@@ -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
Signature · 1 line
2.1.0
#6 lore raw

Re: [PATCH 3/3] start-statd: Use the canonical to check if systemd is running.

Quoted 15 lines · Steve Dickson

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

to check if systemd is installed and running

---
 utils/statd/start-statd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
utils/statd/start-statd +0 -0
index ec9383b..b32b3a5 100755

utils/statd/start-statd line 13

Quoted 8 lines
utils/statd/start-statd +1 -1
@@ -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.

Quoted 7 lines
Signature · 6 lines
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html