Skip to contentSkip to conversation

nfs-utils: Add StateDirectory for systemd services

PATCH New Joshua Watt 1 participant 1 message Sep 12, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs-utils: Add StateDirectory for systemd services

Adds StateDirectory=nfs for the systemd service. This ensures that 1) and .mount services required for /var/lib/nfs are started before these services, and 2) that /var/lib/nfs exists before starting the services.

---
 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service | 1 +
 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service | 1 +
 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service  | 1 +
 3 files changed, 3 insertions(+)
meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service +1 -0
index c01415de842..ebfe64b9ced 100644
@@ -12,6 +12,7 @@ ConditionPathExists=@SYSCONFDIR@/exports
 EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
 ExecStart=@SBINDIR@/rpc.mountd -F $MOUNTD_OPTS
 LimitNOFILE=@HIGH_RLIMIT_NOFILE@
+StateDirectory=nfs
 
 [Install]
 WantedBy=multi-user.target
meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service +1 -0
index 5c845b7e82f..15ceee04d0d 100644
@@ -18,6 +18,7 @@ ExecStopPost=@SBINDIR@/exportfs -au
 ExecStopPost=@SBINDIR@/exportfs -f
 ExecReload=@SBINDIR@/exportfs -r
 RemainAfterExit=yes
+StateDirectory=nfs
 
 [Install]
 WantedBy=multi-user.target
meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service +1 -0
index d1ac785b04b..b519194121c 100644
@@ -10,6 +10,7 @@ ConditionPathExists=@SYSCONFDIR@/exports
 EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
 ExecStart=@SBINDIR@/rpc.statd -F $STATD_OPTS
 LimitNOFILE=@HIGH_RLIMIT_NOFILE@
+StateDirectory=nfs
 
 [Install]
 WantedBy=multi-user.target
Signature · 1 line
2.34.1