1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-29 12:03:03 +00:00

- 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
This commit is contained in:
Florent Thoumie 2006-04-11 09:20:47 +00:00
parent 56f964f063
commit ef04a10fe9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=157657

View File

@ -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'