Skip to content
This repository has been archived by the owner on Nov 11, 2019. It is now read-only.

Commit

Permalink
Merge NFS client services from jackb80.
Browse files Browse the repository at this point in the history
I've fixed the units to match our policies and Fedora ones better but
would have to do some testing.
  • Loading branch information
mgorny committed Dec 17, 2011
2 parents bac33ac + af70620 commit 732935c
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 0 deletions.
9 changes: 9 additions & 0 deletions net-fs:nfs-utils/nfs3_client.target
@@ -0,0 +1,9 @@
[Unit]
Description=Dependencies for NFSv3 mounts
Requires=rpc.statd.service
Wants=sm-notify.service
After=rpc.statd.service sm-notify.service
Before=remote-fs.target

[Install]
WantedBy=multi-user.target
11 changes: 11 additions & 0 deletions net-fs:nfs-utils/nfs4_client.target
@@ -0,0 +1,11 @@
[Unit]
Description=Dependencies for NFSv4 mounts
Requires=rpc.idmapd.service
Requires=rpc.statd.service
Wants=sm-notify.service
Wants=rpc.gssd.service
After=rpc.idmapd.service rpc.statd.service sm-notify.service rpc.gssd.service
Before=remote-fs.target

[Install]
WantedBy=multi-user.target
10 changes: 10 additions & 0 deletions net-fs:nfs-utils/rpc.gssd.service
@@ -0,0 +1,10 @@
[Unit]
Description=NFS rpcsec_gss daemon
Requires=var-lib-nfs-rpc_pipefs.mount
After=syslog.target var-lib-nfs-rpc_pipefs.mount

[Service]
ExecStart=/usr/sbin/rpc.gssd -f

[Install]
WantedBy=multi-user.target
11 changes: 11 additions & 0 deletions net-fs:nfs-utils/rpc.idmapd.service
@@ -0,0 +1,11 @@
[Unit]
Description=NFSv4 ID-name mapping daemon
Wants=var-lib-nfs-rpc_pipefs.mount
Requires=network.target var-lib-nfs-rpc_pipefs.mount
After=syslog.target network.target named.service

[Service]
ExecStart=/usr/sbin/rpc.idmapd -f

[Install]
WantedBy=nfsmount.target
9 changes: 9 additions & 0 deletions net-fs:nfs-utils/rpc.statd.service
@@ -0,0 +1,9 @@
[Unit]
Description=NFS file locking service
After=syslog.target network.target rpcbind.service

[Service]
ExecStart=/sbin/rpc.statd --no-notify -d -F

[Install]
WantedBy=multi-user.target
6 changes: 6 additions & 0 deletions net-fs:nfs-utils/sm-notify.service
@@ -0,0 +1,6 @@
[Unit]
Description=NFS reboot notification service
After=syslog.target network.target rpcbind.service

[Service]
ExecStart=/usr/sbin/sm-notify -d

3 comments on commit 732935c

@justusranvier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My test system has a NFS 4 client so that's what I developed the original files for. I've got a few questions about the modifications.

sm-notify isn't a daemon - it runs once at bootup to notify the other members of the network and then exits. Shouldn't that be Type=oneshot?

Do all of those files actually need [Install] sections? Most of them are purely dependencies of the services that a user would actually want (nfs3_client.target or nfs4_client.target)?

What is the reasoning for making nfs3_client.target and nfs4_client.target WantedBy=multi-user.target instead of remote-fs.target?

@mgorny
Copy link
Member Author

@mgorny mgorny commented on 732935c Dec 18, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd appreciate an information whether it still works then. I've got only NFS3 to test it on.

Thanks, fixed sm-notify. Type=oneshot is not exactly that because it assumes starting dependent services (like nfs3-client) should be delayed until it exits. Type=simple with RemainAfterExit=yes is better.

Well, I assumed user can want to choose the services to run him-/herself. NFS client targets are just for those who don't want to think about it.

About remote-fs.target, I just need to check that first. remote-fs-pre.target could be better (or both).

@mgorny
Copy link
Member Author

@mgorny mgorny commented on 732935c Dec 18, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I took a closer look and:

  1. After adjusting the service order a little, sm-notify is now of Type=oneshot,
  2. Services are always supposed to be installed in multi-user.target. remote-fs.target is handled through Before=. That's simply because WantedBy= doesn't imply any ordering and we want NFS services started before mounting.

Please sign in to comment.