[comp.sys.next] For people who use NeXT at home ...

hardy@golem.ps.uci.edu (Meinhard E. Mayer (Hardy)) (04/04/91)

If you are using your NeXT at home, and want to save some memory
here is a little script (inspired by one published in FAQ) to kill 
sendmail, inetd, the 4 biod processes and autonsfmount, which make
sense only if you are on ethernet (if you use uucp, you may want to
keep sendmail). 
Be sure to run it as su or chmod it to 4755 and chown it to root:
I call it kill_processes:
-----
#! /bin/sh -u
PIDS=`ps -ax | bm sendmail | grep -v bm | awk '{print $1}'`
kill -TERM $PIDS
PIDS=`ps -ax | bm autonfsmount | grep -v bm | awk '{print $1}'`
kill -TERM $PIDS
PIDS=`ps -ax | bm inetd | grep -v bm | awk '{print $1}'`
kill -TERM $PIDS
PIDS=`ps -ax | bm biod | grep -v bm | awk '{print $1}'`
kill -TERM $PIDS
 -----
And while I was at it, I also produced a script called 
kfork (the name of a program available under HP-UX for 
killing processes by name), which allows you to kill 
a process by name, without having to run ps -ax and momorize the PID:
I found it particularly useful when several copies of a process like X
are running after toggling back to NeXTStep.


----
#! /bin/sh -u
PIDS=`ps -ax | bm $1 | grep -v bm | awk '{print $1}'`
kill -TERM $PIDS
---

Again, chmod 755 and put it in your bin (or Apps) directory.

BTW: if you want to use these scripts on a non-Mach machine, replace 
bm by fgrep.

Let me know if you find a more elegant way (one could also have a
script to restart the processes, when you take your NeXT-slabtop to the
office, but rebooting does this anyway).


Hardy 
			  -------****-------
Meinhard E. Mayer (Prof.) Department of Physics, University of California
Irvine CA 92717;(714) 856 5543; hardy@golem.ps.uci.edu or MMAYER@UCI.BITNET