Subject: bin/24646: some small fixes for sushi's procs menu
To: None <gnats-bugs@gnats.NetBSD.org>
From: Peter Postma <peter@pointless.nl>
List: netbsd-bugs
Date: 03/02/2004 20:23:34
>Number: 24646
>Category: bin
>Synopsis: some small fixes for sushi's procs menu
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Mar 02 19:24:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: Peter Postma
>Release: NetBSD 1.6ZK
>Organization:
>Environment:
System: NetBSD mercury.pointless.nl 1.6ZK NetBSD 1.6ZK (mercury) #25: Mon Feb 23 15:42:28 CET 2004 root@mercury.pointless.nl:/usr/obj/sys/arch/sparc64/compile/mercury sparc64
Architecture: sparc64
Machine: sparc64
>Description:
Some changes to sushi(8)'s "Processes and Daemons" menu:
* Don't check if the daemons ntpdate, virecover, ipfilter, samba
are running (because they get only started at boot, or are wrappers
to other scripts).
* Exclude lines with 'not supported' in the ouput.
* Top 15 cpu {usage,time} and memory: show really the 15 top daemons
(instead of 14) and fix cpu time.
>How-To-Repeat:
>Fix:
Index: procs/showallprocs/script
===================================================================
RCS file: /cvsroot/src/share/sushi/procs/showallprocs/script,v
retrieving revision 1.1
diff -u -r1.1 script
--- procs/showallprocs/script 26 Apr 2001 02:26:19 -0000 1.1
+++ procs/showallprocs/script 2 Mar 2004 19:13:06 -0000
@@ -1,8 +1,8 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/04/26 02:26:19 garbled Exp $
-for i in `ls -1 /etc/rc.d | grep -v ipfilter`
+for i in `ls -1 /etc/rc.d | egrep -v '(ntpdate|virecover|ipfilter|samba)'`
do
/etc/rc.d/$i forcestatus
done 2>&1 | grep -v unknown | grep -v Usage | grep -v 'not found' \
-| grep -vi permission
+| grep -vi permission | grep -v 'not supported'
Index: procs/showprocs/script
===================================================================
RCS file: /cvsroot/src/share/sushi/procs/showprocs/script,v
retrieving revision 1.1
diff -u -r1.1 script
--- procs/showprocs/script 26 Apr 2001 02:26:19 -0000 1.1
+++ procs/showprocs/script 2 Mar 2004 19:13:06 -0000
@@ -1,7 +1,7 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/04/26 02:26:19 garbled Exp $
-for i in `ls -1 /etc/rc.d | grep -v ipfilter`
+for i in `ls -1 /etc/rc.d | egrep -v '(ntpdate|virecover|ipfilter|samba)'`
do
/etc/rc.d/$i status
done 2>&1 | grep -v unknown | grep -v Usage
Index: procs/topcpu/script
===================================================================
RCS file: /cvsroot/src/share/sushi/procs/topcpu/script,v
retrieving revision 1.1
diff -u -r1.1 script
--- procs/topcpu/script 26 Apr 2001 02:26:22 -0000 1.1
+++ procs/topcpu/script 2 Mar 2004 19:13:06 -0000
@@ -1,4 +1,4 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/04/26 02:26:22 garbled Exp $
-ps -aux | sort -rnk 3 | head -15
+ps -auxr | head -16
Index: procs/topmem/script
===================================================================
RCS file: /cvsroot/src/share/sushi/procs/topmem/script,v
retrieving revision 1.1
diff -u -r1.1 script
--- procs/topmem/script 26 Apr 2001 02:26:23 -0000 1.1
+++ procs/topmem/script 2 Mar 2004 19:13:06 -0000
@@ -1,4 +1,4 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/04/26 02:26:23 garbled Exp $
-ps -aux | sort -rnk 4 | head -15
+ps -auxm | head -16
Index: procs/toptime/script
===================================================================
RCS file: /cvsroot/src/share/sushi/procs/toptime/script,v
retrieving revision 1.1
diff -u -r1.1 script
--- procs/toptime/script 26 Apr 2001 02:26:23 -0000 1.1
+++ procs/toptime/script 2 Mar 2004 19:13:06 -0000
@@ -1,4 +1,7 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/04/26 02:26:23 garbled Exp $
-ps -aux | sort -rnk 10 | head -15
+ps=`ps -aux`
+
+echo "$ps" | head -1
+echo "$ps" | tail +2 | sort -k 10 -r | head -15
>Release-Note:
>Audit-Trail:
>Unformatted: