Add the entire "processes" menu. This will allow

starting/stopping/showing/restarting of things in /etc/rc.d.  Also add a
few quick top(1)-like utilties just to round the menu off.
This commit is contained in:
garbled 2001-04-26 02:26:16 +00:00
parent 8b33f6cba9
commit 221495cc86
45 changed files with 315 additions and 4 deletions

View File

@ -1,6 +1,6 @@
# $NetBSD: Makefile,v 1.3 2001/04/25 04:05:04 garbled Exp $
# $NetBSD: Makefile,v 1.4 2001/04/26 02:26:16 garbled Exp $
SUBDIR= info install system users util network
SUBDIR= info install system users procs util network
FILES= help index
FILESDIR=${BINDIR}/sushi

View File

@ -1,7 +1,8 @@
# $NetBSD: index,v 1.4 2001/04/25 03:43:25 garbled Exp $
# $NetBSD: index,v 1.5 2001/04/26 02:26:16 garbled Exp $
install install Software Installation and Maintenance
system system System Maintenance
users users Security & Users
users users Security and Users
procs procs Processes and Daemons
network network Network related configuration
BLANK BLANK BLANK
info info Using sushi (information only)

View File

@ -0,0 +1,12 @@
# $NetBSD: Makefile,v 1.1 2001/04/26 02:26:17 garbled Exp $
SUBDIR= restartallprocs restartprocs showallprocs showprocs startallprocs
SUBDIR+= startprocs stopallprocs stopprocs topcpu topmem toptime
FILES= help index
FILESDIR=${BINDIR}/sushi/procs
MKOBJ= no
.include "../../Makefile.inc"
.include <bsd.prog.mk>
.include <bsd.subdir.mk>

14
share/sushi/procs/help Normal file
View File

@ -0,0 +1,14 @@
Using the various forms and functions in this menu, you can start and stop
daemons on your machine. The configured daemons are those that you have
set up to run at boot time in your /etc/rc.conf file.
Starting/stopping/restarting an unconfigured daemon will not change it's
configuration for the next reboot. If you wish for it to start
automatically at your next boot, you should edit it from the
system/rc.conf menu.
The top 15 process functions are a quick and dirty way for you to observe
which processes on your machine are taking up the most resources. For a
much better and more interactive way to do this, see the top(1) program
and manpage.
$NetBSD: help,v 1.1 2001/04/26 02:26:17 garbled Exp $

13
share/sushi/procs/index Normal file
View File

@ -0,0 +1,13 @@
# $NetBSD: index,v 1.1 2001/04/26 02:26:17 garbled Exp $
showprocs showprocs Show configured and running daemons
showallprocs showallprocs Show all daemons
startprocs startprocs Start configured daemons
startallprocs startallprocs Start any daemon
stopprocs stopprocs Stop configured daemons
stopallprocs stopallprocs Stop any daemon
restartprocs restartprocs Restart configured daemons
restartallprocs restartallprocs Restart any daemon
BLANK BLANK BLANK
topcpu topcpu Show top 15 processes by cpu usage
topmem topmem Show top 15 processes by memory usage
toptime toptime Show top 15 processes by cpu time

View File

@ -0,0 +1,10 @@
# $NetBSD: Makefile,v 1.1 2001/04/26 02:26:18 garbled Exp $
FILES= form help
FILESDIR=${BINDIR}/sushi/procs/restartallprocs
SCRIPTS= script script1
SCRIPTSDIR=${BINDIR}/sushi/procs/restartallprocs
MKOBJ= no
.include "../../../Makefile.inc"
.include <bsd.prog.mk>

View File

@ -0,0 +1,2 @@
# $NetBSD: form,v 1.1 2001/04/26 02:26:18 garbled Exp $
script:script1 Which daemon to restart?

View File

@ -0,0 +1 @@
Using this form you can pick the daemon you wish to restart, and restart it.

View File

@ -0,0 +1,12 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/04/26 02:26:18 garbled Exp $
if [ "$1" = "none" ]; then
echo "None selected, no action taken"
exit 0
fi
/etc/rc.d/$1 forcerestart
if [ "$?" != "0" ]; then
echo "Failed to restart $1"
fi

View File

@ -0,0 +1,9 @@
#!/bin/sh
# $NetBSD: script1,v 1.1 2001/04/26 02:26:18 garbled Exp $
for i in `ls -1 /etc/rc.d`
do
/etc/rc.d/$i forcestatus
done 2>&1 | grep -v unknown | grep -v Usage | grep 'is running' | \
awk '{print $1}'
echo "none"

View File

@ -0,0 +1,10 @@
# $NetBSD: Makefile,v 1.1 2001/04/26 02:26:18 garbled Exp $
FILES= form help
FILESDIR=${BINDIR}/sushi/procs/restartprocs
SCRIPTS= script script1
SCRIPTSDIR=${BINDIR}/sushi/procs/restartprocs
MKOBJ= no
.include "../../../Makefile.inc"
.include <bsd.prog.mk>

View File

@ -0,0 +1,2 @@
# $NetBSD: form,v 1.1 2001/04/26 02:26:18 garbled Exp $
script:script1 Which daemon to restart?

View File

@ -0,0 +1 @@
Using this form you can pick the daemon you wish to restart, and restart it.

View File

@ -0,0 +1,12 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/04/26 02:26:19 garbled Exp $
if [ "$1" = "none" ]; then
echo "None selected, no action taken"
exit 0
fi
/etc/rc.d/$1 restart
if [ "$?" != "0" ]; then
echo "Failed to restart $1"
fi

View File

@ -0,0 +1,9 @@
#!/bin/sh
# $NetBSD: script1,v 1.1 2001/04/26 02:26:19 garbled Exp $
for i in `ls -1 /etc/rc.d`
do
/etc/rc.d/$i status
done 2>&1 | grep -v unknown | grep -v Usage | grep 'is running' | \
awk '{print $1}'
echo "none"

View File

@ -0,0 +1,8 @@
# $NetBSD: Makefile,v 1.1 2001/04/26 02:26:19 garbled Exp $
SCRIPTS= script
SCRIPTSDIR=${BINDIR}/sushi/procs/showallprocs
MKOBJ= no
.include "../../../Makefile.inc"
.include <bsd.prog.mk>

View File

@ -0,0 +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`
do
/etc/rc.d/$i forcestatus
done 2>&1 | grep -v unknown | grep -v Usage | grep -v 'not found' \
| grep -vi permission

View File

@ -0,0 +1,8 @@
# $NetBSD: Makefile,v 1.1 2001/04/26 02:26:19 garbled Exp $
SCRIPTS= script
SCRIPTSDIR=${BINDIR}/sushi/procs/showprocs
MKOBJ= no
.include "../../../Makefile.inc"
.include <bsd.prog.mk>

View File

@ -0,0 +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`
do
/etc/rc.d/$i status
done 2>&1 | grep -v unknown | grep -v Usage

View File

@ -0,0 +1,10 @@
# $NetBSD: Makefile,v 1.1 2001/04/26 02:26:20 garbled Exp $
FILES= form help
FILESDIR=${BINDIR}/sushi/procs/startallprocs
SCRIPTS= script script1
SCRIPTSDIR=${BINDIR}/sushi/procs/startallprocs
MKOBJ= no
.include "../../../Makefile.inc"
.include <bsd.prog.mk>

View File

@ -0,0 +1,2 @@
# $NetBSD: form,v 1.1 2001/04/26 02:26:20 garbled Exp $
script:script1 Which daemon to start?

View File

@ -0,0 +1 @@
Using this form you can pick the daemon you wish to start, and start it.

View File

@ -0,0 +1,12 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/04/26 02:26:20 garbled Exp $
if [ "$1" = "none" ]; then
echo "None selected, no action taken"
exit 0
fi
/etc/rc.d/$1 forcestart
if [ "$?" != "0" ]; then
echo "Failed to start $1"
fi

View File

@ -0,0 +1,9 @@
#!/bin/sh
# $NetBSD: script1,v 1.1 2001/04/26 02:26:20 garbled Exp $
for i in `ls -1 /etc/rc.d`
do
/etc/rc.d/$i forcestatus
done 2>&1 | grep -v unknown | grep -v Usage | grep 'is not running' | \
awk '{print $1}'
echo "none"

View File

@ -0,0 +1,10 @@
# $NetBSD: Makefile,v 1.1 2001/04/26 02:26:20 garbled Exp $
FILES= form help
FILESDIR=${BINDIR}/sushi/procs/startprocs
SCRIPTS= script script1
SCRIPTSDIR=${BINDIR}/sushi/procs/startprocs
MKOBJ= no
.include "../../../Makefile.inc"
.include <bsd.prog.mk>

View File

@ -0,0 +1,2 @@
# $NetBSD: form,v 1.1 2001/04/26 02:26:20 garbled Exp $
script:script1 Which daemon to start?

View File

@ -0,0 +1 @@
Using this form you can pick the daemon you wish to start, and start it.

View File

@ -0,0 +1,12 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/04/26 02:26:20 garbled Exp $
if [ "$1" = "none" ]; then
echo "None selected, no action taken"
exit 0
fi
/etc/rc.d/$1 start
if [ "$?" != "0" ]; then
echo "Failed to start $1"
fi

View File

@ -0,0 +1,9 @@
#!/bin/sh
# $NetBSD: script1,v 1.1 2001/04/26 02:26:20 garbled Exp $
for i in `ls -1 /etc/rc.d`
do
/etc/rc.d/$i status
done 2>&1 | grep -v unknown | grep -v Usage | grep 'is not running' | \
awk '{print $1}'
echo "none"

View File

@ -0,0 +1,10 @@
# $NetBSD: Makefile,v 1.1 2001/04/26 02:26:21 garbled Exp $
FILES= form help
FILESDIR=${BINDIR}/sushi/procs/stopallprocs
SCRIPTS= script script1
SCRIPTSDIR=${BINDIR}/sushi/procs/stopallprocs
MKOBJ= no
.include "../../../Makefile.inc"
.include <bsd.prog.mk>

View File

@ -0,0 +1,2 @@
# $NetBSD: form,v 1.1 2001/04/26 02:26:21 garbled Exp $
script:script1 Which daemon to stop?

View File

@ -0,0 +1 @@
Using this form you can pick the daemon you wish to stop, and stop it.

View File

@ -0,0 +1,12 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/04/26 02:26:21 garbled Exp $
if [ "$1" = "none" ]; then
echo "None selected, no action taken"
exit 0
fi
/etc/rc.d/$1 forcestop
if [ "$?" != "0" ]; then
echo "Failed to stop $1"
fi

View File

@ -0,0 +1,9 @@
#!/bin/sh
# $NetBSD: script1,v 1.1 2001/04/26 02:26:21 garbled Exp $
for i in `ls -1 /etc/rc.d`
do
/etc/rc.d/$i forcestatus
done 2>&1 | grep -v unknown | grep -v Usage | grep 'is running' | \
awk '{print $1}'
echo "none"

View File

@ -0,0 +1,10 @@
# $NetBSD: Makefile,v 1.1 2001/04/26 02:26:21 garbled Exp $
FILES= form help
FILESDIR=${BINDIR}/sushi/procs/stopprocs
SCRIPTS= script script1
SCRIPTSDIR=${BINDIR}/sushi/procs/stopprocs
MKOBJ= no
.include "../../../Makefile.inc"
.include <bsd.prog.mk>

View File

@ -0,0 +1,2 @@
# $NetBSD: form,v 1.1 2001/04/26 02:26:21 garbled Exp $
script:script1 Which daemon to stop?

View File

@ -0,0 +1 @@
Using this form you can pick the daemon you wish to stop, and stop it.

View File

@ -0,0 +1,12 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/04/26 02:26:22 garbled Exp $
if [ "$1" = "none" ]; then
echo "None selected, no action taken"
exit 0
fi
/etc/rc.d/$1 stop
if [ "$?" != "0" ]; then
echo "Failed to stop $1"
fi

View File

@ -0,0 +1,9 @@
#!/bin/sh
# $NetBSD: script1,v 1.1 2001/04/26 02:26:22 garbled Exp $
for i in `ls -1 /etc/rc.d`
do
/etc/rc.d/$i status
done 2>&1 | grep -v unknown | grep -v Usage | grep 'is running' | \
awk '{print $1}'
echo "none"

View File

@ -0,0 +1,8 @@
# $NetBSD: Makefile,v 1.1 2001/04/26 02:26:22 garbled Exp $
SCRIPTS= script
SCRIPTSDIR=${BINDIR}/sushi/procs/topcpu
MKOBJ= no
.include "../../../Makefile.inc"
.include <bsd.prog.mk>

View File

@ -0,0 +1,4 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/04/26 02:26:22 garbled Exp $
ps -aux | sort -rnk 3 | head -15

View File

@ -0,0 +1,8 @@
# $NetBSD: Makefile,v 1.1 2001/04/26 02:26:23 garbled Exp $
SCRIPTS= script
SCRIPTSDIR=${BINDIR}/sushi/procs/topmem
MKOBJ= no
.include "../../../Makefile.inc"
.include <bsd.prog.mk>

View File

@ -0,0 +1,4 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/04/26 02:26:23 garbled Exp $
ps -aux | sort -rnk 4 | head -15

View File

@ -0,0 +1,8 @@
# $NetBSD: Makefile,v 1.1 2001/04/26 02:26:23 garbled Exp $
SCRIPTS= script
SCRIPTSDIR=${BINDIR}/sushi/procs/toptime
MKOBJ= no
.include "../../../Makefile.inc"
.include <bsd.prog.mk>

View File

@ -0,0 +1,4 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/04/26 02:26:23 garbled Exp $
ps -aux | sort -rnk 10 | head -15