Gossamer Forum
Home : General : Perl Programming :

Kill PID question...

Quote Reply
Kill PID question...
Ok, I've had a look around, and can't seem to find anything other than the normal man pages (like at http://unixhelp.ed.ac.uk/CGI/man-cgi?kill). Does anyone know how to kill more than one process at a time?

maybe something like;

kill 1234,2323,4343,3343

Any feedback wouldbe great. I got 20 processes i gotta kill, and doing each one seperatly will just be a pain in the arse Tongue

Thanks

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [AndyNewby] Kill PID question... In reply to
20 processes to kill?

Yikes...are you sure?

>>can't seem to find anything other than the normal man pages<<

It tells you on the very first line.

>>
Specify the list of processes that kill should signal. Each pid can be one of four things. A process
name in which case processes called that will be signaled. n where n is larger than 0. The process
with pid n will be signaled. -1 in which case all processes from MAX_INT to 2 will be signaled, as
allowed by the issuing user. -n where n is larger than 1, in which case processes in process group n
are signaled. IFF a negative argument is given the signal must be specified first, otherwise it will be
taken as the signal to send.
<<

Last edited by:

RedRum: Feb 1, 2002, 3:14 AM
Quote Reply
Re: [RedRum] Kill PID question... In reply to
Lol..that doesn't help Tongue You have to remember I've only been using servers for just over a month...unlike you who has been using it for over a year (?).

Yeah, I'm sure there are over 20 processes i gotta cancel. Heres a small outtake of 'ps aux';

Quote:
nobody 14329 0.0 0.0 5204 0 ? SW Jan27 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem Ace-host
nobody 14365 0.0 0.0 5204 0 ? SW Jan27 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem Ace-host
nobody 14377 0.0 0.0 5204 0 ? SW Jan27 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem Ace-host
root 14629 0.0 0.0 1564 0 ? SW Jan27 0:00 CROND
nobody 14710 0.0 0.0 5204 0 ? SW Jan27 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem Ace-host
root 14763 0.0 0.0 1568 0 ? SW Jan27 0:00 CROND
Ace-host 14765 0.0 0.0 5868 0 ? SW Jan27 0:35 perl /home/ace-host.com/public_html/small_dumps/getdumpfile.cgi
root 14766 0.0 0.0 1564 0 ? SW Jan27 0:00 CROND
root 14773 0.0 0.0 1568 0 ? SW Jan27 0:00 CROND
Ace-host 14778 0.0 0.0 5868 0 ? SW Jan27 0:29 perl /home/ace-host.com/public_html/small_dumps/getdumpfile.cgi
root 14817 0.0 0.0 1564 0 ? SW Jan27 0:00 CROND
nobody 14837 0.0 0.0 5204 0 ? SW Jan27 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem Ace-host
nobody 14839 0.0 0.0 5216 0 ? SW Jan27 0:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem Ace-host
root 14874 0.0 0.0 1564 0 ? SW Jan27 0:00 CROND
root 14875 0.0 0.0 1568 0 ? SW Jan27 0:00 CROND
Ace-host 14876 0.0 0.0 5160 0 ? SW Jan27 0:26 perl /home/ace-host.com/public_html/small_dumps/getdumpfile.cgi
root 14880 0.0 0.0 1568 0 ? SW Jan27 0:00 CROND
Ace-host 14882 0.0 0.0 5868 0 ? SW Jan27 0:32 perl /home/ace-host.com/public_html/small_dumps/getdumpfile.cgi
root 14884 0.0 0.0 1568 0 ? SW Jan27 0:00 CROND
Ace-host 14886 0.0 0.0 5868 0 ? SW Jan27 0:36 perl /home/ace-host.com/public_html/small_dumps/getdumpfile.cgi
root 14888 0.0 0.0 1568 0 ? SW Jan27 0:00 CROND
Ace-host 14889 0.0 0.0 5868 0 ? SW Jan27 0:33 perl /home/ace-host.com/public_html/small_dumps/getdumpfile.cgi

See what I mean...a real mess! Think I may have screwed up in my cron file settings Frown

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [AndyNewby] Kill PID question... In reply to
>>Lol..that doesn't help <<

>>Specify the list of processes that kill should signal. <<

You don't know what a list is?
Quote Reply
Re: [RedRum] Kill PID question... In reply to
I know what a list is...but when I type in "kill 1234,12334,232" it doesn't work! Says the process ID is not recognised!

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [AndyNewby] Kill PID question... In reply to
Use a space not a comma
Quote Reply
Re: [RedRum] Kill PID question... In reply to
Ahh..thanks Smile

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [AndyNewby] Kill PID question... In reply to
I think you'd be much better off finding the route cause of this probkem. What's going on here? You're firsing off programs via CRON that don't exit properly and send themselves into infinite loops? How does your server cope with the memory usage?

- wil
Quote Reply
Re: [Wil] Kill PID question... In reply to
Its not as bad as it looks. I set up the cron job, but put it to run every 12 minutes, instead of hours Tongue I'm gonna edit the cron file as soon as I can stop enough of the files from running and bogging down the server. I've also changed the name of the file that is running, in a hope that no new copies will now get started Smile

Thanks

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [AndyNewby] Kill PID question... In reply to
Just do a killall perl and a killall /usr/bin/sendmail (then restart sendmail). Of course this won't work if you have other perl or sendmail processes running that you don't want killed.

Adrian
Quote Reply
Re: [brewt] Kill PID question... In reply to
Cool. I'll try that. Thanks Smile

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [brewt] Kill PID question... In reply to
Darn. The 'killall /usr/sbin/sendmail' command worked, but doing 'killall perl' doesn't seem to. It looks like the command was executed (no error message), but none of the processes are actually stopped!

Any ideas? Does it matter who I am logged in with for my telnet session?

Also, anyone know why I'm getting loads of copies of httpd running?

nobody 24422 0.0 3.8 5328 2428 ? D 10:16 0:00 /usr/local/apache/bin/httpd -DSSL
nobody 24425 0.0 4.2 5356 2656 ? D 10:16 0:00 /usr/local/apache/bin/httpd -DSSL
nobody 24426 0.0 4.2 5356 2640 ? D 10:16 0:00 /usr/local/apache/bin/httpd -DSSL
nobody 24432 0.0 4.1 5328 2580 ? D 10:16 0:00 /usr/local/apache/bin/httpd -DSSL
nobody 24433 0.0 4.1 5328 2580 ? D 10:16 0:00 /usr/local/apache/bin/httpd -DSSL
nobody 24436 0.0 4.0 5328 2500 ? S 10:19 0:00 /usr/local/apache/bin/httpd -DSSL
nobody 24437 0.0 4.0 5328 2500 ? S 10:19 0:00 /usr/local/apache/bin/httpd -DSSL
nobody 24438 0.0 4.0 5328 2500 ? S 10:19 0:00 /usr/local/apache/bin/httpd -DSSL
nobody 24439 0.0 4.0 5328 2500 ? S 10:19 0:00 /usr/local/apache/bin/httpd -DSSL
nobody 24440 0.0 4.0 5328 2500 ? S 10:19 0:00 /usr/local/apache/bin/httpd -DSSL

Is this just where users are accessing my sites?

Thanks

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

AndyNewby: Feb 2, 2002, 2:19 AM