diff options
author | flz <flz@FreeBSD.org> | 2006-04-11 09:20:47 +0000 |
---|---|---|
committer | flz <flz@FreeBSD.org> | 2006-04-11 09:20:47 +0000 |
commit | 386dfb985a1490acefe5ee60015362aec3fce3fe (patch) | |
tree | dd40a51f7f34e2d9bbb56214a7452af8e849fba5 /etc | |
parent | 3d79b5ee35df0602d85388ec69eb0692b54ec544 (diff) | |
download | FreeBSD-src-386dfb985a1490acefe5ee60015362aec3fce3fe.zip FreeBSD-src-386dfb985a1490acefe5ee60015362aec3fce3fe.tar.gz |
- If no pidfile has been created at startup, only stop processes
with current jid.
PR: conf/93287
Submitted by: anders
Approved by: cperciva (mentor)
MFC after: 1 month
Diffstat (limited to 'etc')
-rw-r--r-- | etc/rc.subr | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/etc/rc.subr b/etc/rc.subr index eafcd76..20eae17 100644 --- a/etc/rc.subr +++ b/etc/rc.subr @@ -54,6 +54,7 @@ SYSCTL_N="${SYSCTL} -n" CMD_OSTYPE="${SYSCTL_N} kern.ostype" OSTYPE=`${CMD_OSTYPE}` ID="/usr/bin/id" +JID=`ps -p $$ -o jid | tail -1 | tr -d ' '` IDCMD="if [ -x $ID ]; then $ID -un; fi" case ${OSTYPE} in @@ -275,14 +276,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' |