On Tuesday, October 30, 2001, at 10:39 PM, charles wrote:
I have a pain in the processes .....This little creep is doing something to
cause my server to slow down. He's doing it to my sendmail
server.......After a while I have several processes running in sendmail like
the following:
Hi Charles -
Give this a shot. Note that the kill command needs to have the echo
removed if it looks like it's doing the right thing. If the sendmails
are still hanging around, after the kill, substitute in the kill -9
version. Let me know how it works.
== begin script ==
#!/bin/sh
# look for our target info
ps -ax | grep '/usr/sbin/sendmail -bd -q1h' | grep -v grep |
# read it as it comes off the last pipe
# only interested in first parameter, junk the rest of the line
while read procID junk
do
# check the process id
if (( $procID > 1000 ))
then
# in range - kill it (may need kill -9 $procID)
echo kill $procID
else
# beyond range - ignore it
echo ignore $procID
fi
done
== end script ==
4571 ? S 0:00 /usr/sbin/sendmail -bd -q1h
4678 ? S 0:00 /usr/sbin/sendmail -bd -q1h
5712 ? S 0:00 /usr/sbin/sendmail -bd -q1h
5981 ? S 0:00 /usr/sbin/sendmail -bd -q1h
5999 ? S 0:00 /usr/sbin/sendmail -bd -q1h
6023 ? S 0:00 /usr/sbin/sendmail -bd -q1h
6145 ? S 0:00 /usr/sbin/sendmail -bd -q1h
If I check with ps ax periodically and see this in my processes I simply
kill 4571 etc. and things speed up again. What I need to do is run an sh
script with cron to automatically Grep /usr/sbin/sendmail -bd -q1h and if
the pid is above 1000, kill it. The problem is that I really don't know how
to write it. It shouldn'nt take more than a couple of lines of code but I'm
not real good with the syntax yet..........although I am aware of what needs
to be done :o)
can any of the GURU's help with a couple of lines of code. I already sent a
band of thugs with pick axes to his place in Illinois to make green monkey
squirt of his computers but in the mean time I need to solve this little
problem :o)
any help would be appreciated
C
---
Tenon Intersystems' itools Mailing List
To unsubscribe: send mailto://itools-request@xxxxxxxxxxxxxxx
with the body: unsubscribe
Mike Schienle
Interactive Visuals, Inc.
http://www.ivsoftware.com
---
Tenon Intersystems' itools Mailing List
To unsubscribe: send mailto://itools-request@xxxxxxxxxxxxxxx
with the body: unsubscribe
|