summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2025-05-28 10:08:52 +0800
committerSteve Sakoman <steve@sakoman.com>2025-06-04 09:06:31 -0700
commit81e0dc80d72d66b7f15a34c0da7a0a8c58809056 (patch)
tree720d486eb3119ec7320010562dd421fdd0ec27e4
parent0238a535e8c7303e2df03be79b2fbe3862701100 (diff)
downloadpoky-kirkstone.tar.gz
nfs-utils: don't use signals to shut down nfs server.kirkstone
Since Linux v2.4 it has been possible to stop all NFS server by running rpc.nfsd 0 i.e. by requesting that zero threads be running. This is preferred as it doesn't risk killing some other process which happens to be called "nfsd". Since Linux v6.6 - and other stable kernels to which Commit: 390390240145 ("nfsd: don't allow nfsd threads to be signalled.") has been backported - sending a signal no longer works to stop nfs server threads. This patch changes the nfsserver script to use "rpc.nfsd 0" to stop server threads. (From OE-Core rev: 415e73d53e5342f3f6ff6acd521ded2df3fbca1f) Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 7b09ad289a36) Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver28
1 files changed, 4 insertions, 24 deletions
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
index 0f5747cc6d..4d78312929 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
@@ -66,34 +66,14 @@ start_nfsd(){
66 start-stop-daemon --start --exec "$NFS_NFSD" -- "$@" 66 start-stop-daemon --start --exec "$NFS_NFSD" -- "$@"
67 echo done 67 echo done
68} 68}
69delay_nfsd(){
70 for delay in 0 1 2 3 4 5 6 7 8 9
71 do
72 if pidof nfsd >/dev/null
73 then
74 echo -n .
75 sleep 1
76 else
77 return 0
78 fi
79 done
80 return 1
81}
82stop_nfsd(){ 69stop_nfsd(){
83 # WARNING: this kills any process with the executable
84 # name 'nfsd'.
85 echo -n 'stopping nfsd: ' 70 echo -n 'stopping nfsd: '
86 start-stop-daemon --stop --quiet --signal 1 --name nfsd 71 $NFS_NFSD 0
87 if delay_nfsd || { 72 if pidof nfsd
88 echo failed
89 echo ' using signal 9: '
90 start-stop-daemon --stop --quiet --signal 9 --name nfsd
91 delay_nfsd
92 }
93 then 73 then
94 echo done
95 else
96 echo failed 74 echo failed
75 else
76 echo done
97 fi 77 fi
98} 78}
99 79