aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Thoumie <flz@FreeBSD.org>2006-05-05 10:02:54 +0000
committerFlorent Thoumie <flz@FreeBSD.org>2006-05-05 10:02:54 +0000
commit8d09b9b0f431441be00887cb3c7667e3992ee21c (patch)
tree823f0d99bb6f9f170c137ee178d4f0317a0e34ba
parent96c54a017a746ebcf51ef294a2f54c13dd520da8 (diff)
MFC:
- If no pidfile has been created at startup, only stop processes with current jid. src/etc/rc.subr: rev 1.53 -> 1.55 PR: conf/93287 Submitted by: anders Approved by: re (scottl)
Notes
Notes: svn path=/releng/6.1/; revision=158307
-rw-r--r--etc/rc.subr11
1 files changed, 7 insertions, 4 deletions
diff --git a/etc/rc.subr b/etc/rc.subr
index b8fc3a9edf7a..6410bccb746e 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -52,6 +52,7 @@ SYSCTL_N="${SYSCTL} -n"
CMD_OSTYPE="${SYSCTL_N} kern.ostype"
OSTYPE=`${CMD_OSTYPE}`
ID="/usr/bin/id"
+JID=`ps -p $$ -o jid=`
IDCMD="if [ -x $ID ]; then $ID -un; fi"
case ${OSTYPE} in
@@ -272,14 +273,16 @@ _find_processes()
fi
_proccheck='
- ps 2>/dev/null -o "pid,command" '"$_psargs"' |
- while read _npid '"$_fp_args"'; do
+ ps 2>/dev/null -o "pid,jid,command" '"$_psargs"' |
+ while read _npid _jid '"$_fp_args"'; do
case "$_npid" in
PID)
continue;;
esac; '"$_fp_match"'
- echo -n "$_pref$_npid";
- _pref=" "
+ if [ "$JID" -eq "$_jid" ];
+ then echo -n "$_pref$_npid";
+ _pref=" ";
+ fi
;;
esac
done'