summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel McGregor <daniel.mcgregor@vecima.com>2025-02-12 13:12:29 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-02-18 11:56:03 +0000
commit5d9a26dfb6a9594a8a268e6e91cc48e841b294ff (patch)
tree3e8ca8b3d04b847a5f376a05432f36f380990aeb
parent3830f872df6226a67600f128298c53f60028b83b (diff)
downloadpoky-5d9a26dfb6a9594a8a268e6e91cc48e841b294ff.tar.gz
nfs-utils: clean up startup
Change the sysvinit script to start at the S runlevel, this matches Debian, and prevents systemd from generating a unit file for it. Also have the nfsd systemd service request the nfsd kernel filesystem mountpoint. This avoids startup failures in unpriviled containers or other setups that don't support the filesystem. (From OE-Core rev: 6110687d199bf390380fe84c330858e3b03f681d) Signed-off-by: Daniel McGregor <daniel.mcgregor@vecima.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon8
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb9
2 files changed, 8 insertions, 9 deletions
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
index 992267d5a1..4f07324a21 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
@@ -1,9 +1,9 @@
1#!/bin/sh 1#!/bin/sh
2### BEGIN INIT INFO 2### BEGIN INIT INFO
3# Provides: nfs-common 3# Provides: nfs-common
4# Required-Start: $portmap hwclock 4# Required-Start: $portmap $time
5# Required-Stop: $portmap hwclock 5# Required-Stop: $portmap $time
6# Default-Start: 2 3 4 5 6# Default-Start: S
7# Default-Stop: 0 1 6 7# Default-Stop: 0 1 6
8# Short-Description: NFS support for both client and server 8# Short-Description: NFS support for both client and server
9# Description: NFS is a popular protocol for file sharing across 9# Description: NFS is a popular protocol for file sharing across
@@ -20,7 +20,7 @@
20. /etc/init.d/functions 20. /etc/init.d/functions
21 21
22test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd 22test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd
23test -z "$STATD_PID" && STATD_PID=/var/run/rpc.statd.pid 23test -z "$STATD_PID" && STATD_PID=/run/rpc.statd.pid
24# 24#
25# The default state directory is /var/lib/nfs 25# The default state directory is /var/lib/nfs
26test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs 26test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb
index ff02a3aea0..df9c95a71f 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb
@@ -133,15 +133,14 @@ do_install:append () {
133 install -m 0644 ${UNPACKDIR}/nfs-server.service ${D}${systemd_system_unitdir}/ 133 install -m 0644 ${UNPACKDIR}/nfs-server.service ${D}${systemd_system_unitdir}/
134 install -m 0644 ${UNPACKDIR}/nfs-mountd.service ${D}${systemd_system_unitdir}/ 134 install -m 0644 ${UNPACKDIR}/nfs-mountd.service ${D}${systemd_system_unitdir}/
135 install -m 0644 ${UNPACKDIR}/nfs-statd.service ${D}${systemd_system_unitdir}/ 135 install -m 0644 ${UNPACKDIR}/nfs-statd.service ${D}${systemd_system_unitdir}/
136 install -m 0644 ${UNPACKDIR}/proc-fs-nfsd.mount ${D}${systemd_system_unitdir}/
136 sed -i -e 's,@SBINDIR@,${sbindir},g' \ 137 sed -i -e 's,@SBINDIR@,${sbindir},g' \
137 -e 's,@SYSCONFDIR@,${sysconfdir},g' \ 138 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
138 -e 's,@HIGH_RLIMIT_NOFILE@,${HIGH_RLIMIT_NOFILE},g' \ 139 -e 's,@HIGH_RLIMIT_NOFILE@,${HIGH_RLIMIT_NOFILE},g' \
139 ${D}${systemd_system_unitdir}/*.service 140 ${D}${systemd_system_unitdir}/*.service
140 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then 141 # Add compatibility symlinks for the sysvinit scripts
141 install -m 0644 ${UNPACKDIR}/proc-fs-nfsd.mount ${D}${systemd_system_unitdir}/ 142 ln -s nfs-server.service ${D}${systemd_system_unitdir}/nfsserver.service
142 install -d ${D}${systemd_system_unitdir}/sysinit.target.wants/ 143 ln -s /dev/null ${D}${systemd_system_unitdir}/nfscommon.service
143 ln -sf ../proc-fs-nfsd.mount ${D}${systemd_system_unitdir}/sysinit.target.wants/proc-fs-nfsd.mount
144 fi
145 144
146 # kernel code as of 3.8 hard-codes this path as a default 145 # kernel code as of 3.8 hard-codes this path as a default
147 install -d ${D}/var/lib/nfs/v4recovery 146 install -d ${D}/var/lib/nfs/v4recovery