LinuxQuestions.org
Visit Jeremy's Blog.
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 11-24-2006, 03:42 AM   #1
micro_xii
Member
 
Registered: Sep 2006
Posts: 140

Rep: Reputation: 15
Question kill command


Greetings:

dmx:/ # lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
httpd 5806 root 4u IPv6 10821 TCP *:http (LISTEN)

kill -9 5806


My question is the kill command is used to stop the service right? Now how can I run again the service that I just kill....
 
Old 11-24-2006, 04:15 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,526

Rep: Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503
You can use pkill, i.e in your example:
Code:
pkill httpd
 
Old 11-24-2006, 05:43 AM   #3
micro_xii
Member
 
Registered: Sep 2006
Posts: 140

Original Poster
Rep: Reputation: 15
restore

Quote:
Originally Posted by bathory
You can use pkill, i.e in your example:
Code:
pkill httpd

What I mean is after you command kill, I will restore it back the one I just kill. What is the command?
 
Old 11-24-2006, 06:03 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,526

Rep: Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503
You have the following options:
Code:
kill -HUP <pid>
killall -HUP <process-name>
pkill -HUP <process-name>
 
Old 11-24-2006, 09:48 AM   #5
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
micro_xii, I think you're asking if this is the "right" way to kill the web server, yes?

Usually the web server will be started and stopped using init scripts. While kill will probably work, you might be better off using the init scripts (if they are how it's done on your system). The name of the init script will vary from distro to distro, here's a few alternatives:
Code:
/etc/init.d/apache stop
/etc/init.d/apache2 stop
/etc/init.d/httpd stop
Those are variations I've seen, but there may be many more.
 
  


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
Kill command could not kill Kanaflloric Linux - General 11 08-22-2005 08:18 AM
kill command question chunlee Linux - Newbie 5 10-18-2004 01:45 PM
The kill command tearinox Linux - Newbie 2 08-15-2003 05:40 PM
Kill a process by command ITJedi Programming 3 03-07-2003 11:49 AM
kill command... Sonny Linux - Newbie 2 01-28-2002 04:08 AM


All times are GMT -5. The time now is 01:12 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration