From owner-freebsd-arch Sun Jun 17 15:47:33 2001 Delivered-To: freebsd-arch@freebsd.org Received: from area51.v-wave.com (area51.v-wave.com [24.108.173.252]) by hub.freebsd.org (Postfix) with SMTP id BFFA037B406 for ; Sun, 17 Jun 2001 15:47:17 -0700 (PDT) (envelope-from flatline@area51.v-wave.com) Received: (qmail 38691 invoked by uid 1001); 17 Jun 2001 22:47:17 -0000 Date: Sun, 17 Jun 2001 16:47:17 -0600 From: Chris Wasser To: arch@freebsd.org Subject: netbsd rc.subr diff #2 Message-ID: <20010617164716.H582@skunkworks.arpa.mil> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="UHN/qo2QbUvPLonB" Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Operating-System: FreeBSD 4.2-STABLE i386 X-Subliminal: On the count of 3, you will bark like a dog. 1.. 2.. 3.. Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --UHN/qo2QbUvPLonB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I hate to spam the list with repetitious emails; attached is my current running diff against /etc/rc.subr which now implements the change suggested by Kelly Yancey which removes the header from the ps output, thus removing the check for it. --UHN/qo2QbUvPLonB Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="rc.subr.diff" --- rc.subr Sun Jun 17 14:14:16 2001 +++ rc.subr.new Sun Jun 17 16:40:12 2001 @@ -116,12 +116,10 @@ return fi _procnamebn=${_procname##*/} - ps -p $_pid -o 'pid,command' | while read _npid _arg0 _argv; do - if [ "$_npid" = "PID" ]; then - continue - fi + ps -p $_pid -o 'pid,command' | tail +2 | sort +1 | while read _npid _arg0 _argv; do if [ "$_arg0" = "$_procname" \ -o "$_arg0" = "$_procnamebn" \ + -o "$_arg0" = "/${_procnamebn}" \ -o "$_arg0" = "${_procnamebn}:" \ -o "$_arg0" = "(${_procnamebn})" ]; then echo $_npid @@ -143,12 +141,10 @@ fi _procnamebn=${_procname##*/} _pref= - ps -ax -o 'pid,command' | while read _npid _arg0 _argv; do - if [ "$_npid" = "PID" ]; then - continue - fi + ps -ax -o 'pid,command' | tail +2 | sort +1 | while read _npid _arg0 _argv; do if [ "$_arg0" = "$_procname" \ -o "$_arg0" = "$_procnamebn" \ + -o "$_arg0" = "/${_procnamebn}" \ -o "$_arg0" = "${_procnamebn}:" \ -o "$_arg0" = "(${_procnamebn})" ]; then echo -n "$_pref$_npid" --UHN/qo2QbUvPLonB-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message