LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware-current, A manual rc.nfsd start execution , then , rc.nfsd stop , rpc processes still running & patch . (https://www.linuxquestions.org/questions/slackware-14/slackware-current-a-manual-rc-nfsd-start-execution-then-rc-nfsd-stop-rpc-processes-still-running-and-patch-4175735851/)

babydr 04-09-2024 09:39 PM

Slackware-current, A manual rc.nfsd start execution , then , rc.nfsd stop , rpc processes still running & patch .
 
1 Attachment(s)
Hello Pat , When manually running rc.nfsd start , just for a momentary copying of files , then , rc.nfsd stop , I noticed rpc processes still running .
Here is a small patch , not well tested but here goes .

Code:

# diff -u rc.nfsd.orig rc.nfsd
--- rc.nfsd.orig        2023-08-06 11:20:50.000000000 -0800
+++ rc.nfsd    2024-04-09 18:14:00.647157981 -0800
@@ -85,6 +85,12 @@
  killall nfsd 2> /dev/null
  sleep 1
  killall -9 nfsd 2> /dev/null # make sure :)
+  # If basic RPC services are running, stop them:
+  if ps axc | grep -q rpc.statd ; then
+    if [ ! -x /etc/rc.d/rc.rpc ]; then
+      sh /etc/rc.d/rc.rpc stop
+    fi
+  fi
  killall rpc.rquotad 2> /dev/null
  /usr/sbin/exportfs -au 2> /dev/null
 }

And attached is what testing I have done ...
ps: I don't use ipv6 so it is disabled at boot .

jayjwa 04-10-2024 12:47 PM

What happens if that machine has other RPC services running?

babydr 04-10-2024 07:29 PM

@ Jayjwa , Then /etc/rc.d/rc.rpc would be set executable .

babydr 04-12-2024 07:59 PM

would someone please look at this ? sinc the patch was editted for correctness ...?

babydr 04-16-2024 06:35 PM

The updated patch . Again , Hoping someone will at least look at it . Tia , JimL

Code:

# diff -u rc.nfsd.orig rc.nfsd
--- rc.nfsd.orig        2024-04-16 15:30:30.741074598 -0800
+++ rc.nfsd    2024-04-16 15:22:53.899067498 -0800
@@ -85,6 +85,12 @@
  killall nfsd 2> /dev/null
  sleep 1
  killall -9 nfsd 2> /dev/null # make sure :)
+  # If basic RPC services are running, stop them:
+  if ps axc | grep -q rpc.statd ; then
+    if [ ! -x /etc/rc.d/rc.rpc ]; then
+      sh /etc/rc.d/rc.rpc stop
+    fi
+  fi
  killall rpc.rquotad 2> /dev/null
  /usr/sbin/exportfs -au 2> /dev/null
 }


volkerdi 04-16-2024 07:06 PM

Quote:

Originally Posted by babydr (Post 6496466)
The updated patch . Again , Hoping someone will at least look at it . Tia , JimL

Code:

# diff -u rc.nfsd.orig rc.nfsd
--- rc.nfsd.orig        2024-04-16 15:30:30.741074598 -0800
+++ rc.nfsd    2024-04-16 15:22:53.899067498 -0800
@@ -85,6 +85,12 @@
  killall nfsd 2> /dev/null
  sleep 1
  killall -9 nfsd 2> /dev/null # make sure :)
+  # If basic RPC services are running, stop them:
+  if ps axc | grep -q rpc.statd ; then
+    if [ ! -x /etc/rc.d/rc.rpc ]; then
+      sh /etc/rc.d/rc.rpc stop
+    fi
+  fi
  killall rpc.rquotad 2> /dev/null
  /usr/sbin/exportfs -au 2> /dev/null
 }


I've looked at it. I'm more generous about automatically starting things than stopping them, I guess.


All times are GMT -5. The time now is 08:02 AM.