LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 07-08-2003, 08:14 AM   #1
dvong3
Member
 
Registered: Sep 2002
Posts: 168

Rep: Reputation: 30
kill process


I have several deamon (ftp, telnet, ssh) running on my Linux box. How do I kill the process? What syntax should I use (kill -*** **)

Danny
 
Old 07-08-2003, 08:23 AM   #2
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
I believe man signal will give you more info, but here's what I use:

ps aux | grep programname
So:
ps aux | grep ftp
Would give me info about where proftpd is running, then I'd note the pid and:
kill -15 1234
Where 1234 is the pid.

A 15 signal tells the application to finish up and close. It's clean. If your application doesn't respond to that, you can kill -9 it instead.

A 9 signal tells it to stop right now and close, actually I think it might even happen further up the chain of events, such as get killed from it's source rather than the application itself. It's much worse for the application, and should only be used when 15 (or others) aren't working.

I hope I've got those correct, see man signal for more info

Cool
 
Old 07-08-2003, 08:29 AM   #3
dvong3
Member
 
Registered: Sep 2002
Posts: 168

Original Poster
Rep: Reputation: 30
Thanks! What about Kill -HUP? when do you use -HUP?
 
Old 07-08-2003, 08:31 AM   #4
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
I use HUP when I need to restart inetd, such is the case if I use proftpd in inetd mode rather than standalone.

A HUP signal stands for (IIRC) Hang UP; it means:
After you finish what you are doing, simply restart your process, re-read your configuration file, and move on as if nothing happened.

Or something like that

HTH

Cool
 
Old 07-08-2003, 08:31 AM   #5
davee
Member
 
Registered: Oct 2002
Location: Ayrshire, Scotland
Distribution: Suse(home) RHEL (Work)
Posts: 263

Rep: Reputation: 30
kill -kill is a good one if nothing else works...!

FOr services such as ftp, try:

/sbin/service --status-all | grep ftp

...if it's recognised, you should get a response such as:

vsftpd (pid 10234) is running...

If so, you can then do:

/sbin/service vsftpd stop

to stop the service.

Another thing to look at - do a:

/sbin/chkconfig --list | more

to see all services that start automatically. See man chkconfig for more options.

Dave
 
Old 07-08-2003, 08:40 AM   #6
MiscGeek
Member
 
Registered: Jan 2003
Location: Georgia, US
Distribution: RHEL WS4
Posts: 189

Rep: Reputation: 30
Quote:
Originally posted by davee

Another thing to look at - do a:

/sbin/chkconfig --list | more

to see all services that start automatically. See man chkconfig for more options.

Dave
Also, if you don't want to run the daemons to start automatically chkconfig is your friend. As Dave suggested run man chkconfig. You can use it to control what daemons start and what run level they start at.

Mike
 
Old 07-08-2003, 10:17 AM   #7
darin3200
Guru
 
Registered: Dec 2002
Distribution: Gentoo!
Posts: 1,153

Rep: Reputation: 45
You can use 'top' to see all of the process running with who is running them and their pid.
 
Old 07-08-2003, 10:44 AM   #8
dav1x
Member
 
Registered: Sep 2002
Posts: 50

Rep: Reputation: 15
I also enjoy the command pkill.

With pkill you can actually kill commands simply by name alone and not by PIDs.

Give it a try sometime.
 
Old 07-08-2003, 10:27 PM   #9
MiscGeek
Member
 
Registered: Jan 2003
Location: Georgia, US
Distribution: RHEL WS4
Posts: 189

Rep: Reputation: 30
Smile

Quote:
Originally posted by dav1x
I also enjoy the command pkill.

With pkill you can actually kill commands simply by name alone and not by PIDs.

Give it a try sometime.
Cool, learn something new everyday Can't believe I've never found that...

Mike
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Process won't kill mrsolo Linux - Software 5 08-03-2007 01:45 PM
I want to kill process Jeon, Chang-Min Linux - General 6 08-09-2005 01:14 AM
cannot kill process (kill -9 does not work) mazer13a Linux - General 1 05-27-2005 03:32 PM
Cannot kill process Zeno McDohl Linux - General 13 04-14-2005 03:31 PM
can't kill the process ust Linux - Software 1 09-15-2004 07:05 AM


All times are GMT -5. The time now is 09:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration