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
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 <[email protected]>
---
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
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 <[email protected]>
> ---
> 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
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
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 <[email protected]>
>> ---
>> 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
>> [email protected]
>> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
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 <[email protected]>
---
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
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 <[email protected]>
---
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
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 <[email protected]>
> ---
> 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 [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html