--- nfsd 2006-10-18 11:15:50.000000000 +0200 +++ nfsd.new 2006-10-18 11:15:47.000000000 +0200 @@ -44,4 +44,42 @@ return 0 } +# Overwrite the _find_processes() function. We are only interested in the +# nfsd master process. Only this one should get the kill signal. + +_find_processes() +{ + if [ $# -ne 3 ]; then + err 3 'USAGE: _find_processes procname interpreter psargs' + fi + _procname=$1 + _interpreter=$2 + _psargs=$3 + + _pref= + _procnamebn=${_procname##*/} + _fp_args='_arg0 _argv _x' + _fp_match='case "$_arg0" in + $_procname|$_procnamebn|${_procnamebn}:|"(${_procnamebn})"|"[${_procnamebn}]")' + + _proccheck=' + ps 2>/dev/null -o "pid,jid,command" '"$_psargs"' | + while read _npid _jid '"$_fp_args"'; do + case "$_npid" in + PID) + continue;; + esac; '"$_fp_match"' + if [ "$_argv" = "master" -a "$JID" -eq "$_jid" ]; + then echo -n "$_pref$_npid"; + _pref=" "; + fi + ;; + esac + done' + +# debug "in _find_processes: proccheck is ($_proccheck)." + eval $_proccheck +} + + run_rc_command "$1"