Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

nfs-utils: systemd support

Let's provide only a few of the units with lservices and install the low-level files directly.

Also, for some stupid reason, I had to patch start-statd to work with the _provided_
systemd files...
  • Loading branch information...
commit 5a645b8195583ec5ca92236108c79a2b21056cb7 1 parent 0a44069
v4hn authored v4hn committed
View
13 filesys/nfs-utils/BUILD
@@ -1,5 +1,3 @@
-(
-
add_priv_user nfs:daemon &&
# please DO NOT remove --disable-tirpc even if ./configure shows
@@ -13,7 +11,14 @@
$OPTS &&
default_make &&
+
+ # install all auxiliary service files directly
+ for f in nfs-blkmap.service nfs-config.service nfs-idmapd.service \
+ nfs-mountd.service nfs-utils.service proc-fs-nfsd.mount \
+ rpc-gssd.service rpc-statd-notify rpc-statd.service \
+ rpc-svcgssd.service var-lib-nfs-rpc_pipefs.mount; do
+ install -Dm0644 "systemd/$f" "/usr/lib/systemd/system/$f"
+ done &&
+
devoke_installwatch &&
chown -R nfs:daemon /var/lib/nfs
-
-) > $C_FIFO 2>&1
View
3  filesys/nfs-utils/PRE_BUILD
@@ -0,0 +1,3 @@
+default_pre_build &&
+
+sedit 's@/usr/sbin@\0:/usr/bin@; s/statd\.service/rpc-\0/' utils/statd/start-statd
View
8 filesys/nfs-utils/systemd.d/nfs-blkmap.target
@@ -0,0 +1,8 @@
+[Unit]
+Description= PNFS blkmaping enablement.
+# If this target is enabled, then blkmapd will be started
+# as required. If it is not enabled it won't.
+
+[Install]
+WantedBy=remote-fs.target
+WantedBy=multi-user.target
View
14 filesys/nfs-utils/systemd.d/nfs-client.target
@@ -0,0 +1,14 @@
+[Unit]
+Description=NFS client services
+Before=remote-fs-pre.target
+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 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
+WantedBy=remote-fs.target
View
30 filesys/nfs-utils/systemd.d/nfs-server.service
@@ -0,0 +1,30 @@
+[Unit]
+Description=NFS server and services
+Requires= network.target proc-fs-nfsd.mount rpcbind.target
+Requires= nfs-mountd.service
+Wants=rpc-statd.service nfs-idmapd.service rpc-gssd.service rpc-svcgssd.service
+Wants=rpc-statd-notify.service
+
+After= network.target proc-fs-nfsd.mount rpcbind.target nfs-mountd.service
+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
+
+Type=oneshot
+RemainAfterExit=yes
+ExecStartPre=/usr/sbin/exportfs -r
+ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS
+ExecStop=/usr/sbin/rpc.nfsd 0
+ExecStopPost=/usr/sbin/exportfs -au
+ExecStopPost=/usr/sbin/exportfs -f
+
+ExecReload=/usr/sbin/exportfs -r
+
+[Install]
+WantedBy=multi-user.target
Please sign in to comment.
Something went wrong with that request. Please try again.