Kill is Your Friend

Ah, slowly I am earning my beans in Ubuntu land. Tonight I had my first legitimate need to use kill and even found out what a PID number was and EVEN read my LOG FILES!! Wow. If you’re just learning Apache admin stuff and just can’t reload or restart your web server, head on over to /var/log/apache2 and check out your error.log file. You prolly shouldn’t randomly kill .pids but if you’re getting a repeated httpd error like mine: “httpd (pid 5347?) not started” it could be that the server was manually shut down (oops, old Windows debugging tactic) and the process just needs to be murdered.

kill 5347

Worked like a charm. Another hint for you fellow newbs…maybe reading an Apache admin book would actually SAVE you time, eh? All I needed to do to enable my dern rewrite was to change AllowOverride None to AllowOverride all in my sites-enabled config. Hmmm….I bet a quick doc on configuring sites in Apache2 would have saved me all that. But then I wouldn’t have ever found out how to kill stuff on linux…so then again, maybe it was all worth it.

Awesome drawing by pure evil bunny on Flickr.

9 thoughts on “Kill is Your Friend”

  1. kill -9 PID….sounds ominous…will definitely look into it, or should I just key it in and see what happens, heheh?

  2. It can be useful to pair the kill command with the pgrep command (which determines the PID of a process).

    For example, I find that the email reader evolution often crashes, leaving behind 2 or 3 processes that prevent a new version of evolution from being started. In this case I use the command,
    pgrep evolution | xargs kill

    This finds the pid of any processes with “evolution” in the name, then pipes this to “kill” using the xargs command, thus killing all those processes.

  3. I never knew you could kill by name like that. Sure is a hassle to open up top and look around for PIDs. I bet you could simply script that command to something similar to kill so you could type

    killname (or something) evolution

    instead of

    pgrep evolution | xargs kill

  4. I’m really lame. To kill Firefox, I use pkill firefox. If I can’t guess it that way, I use htop to find the process (or just hit Ctrl+Shift+Esc in KDE) and then use killall firefox-bin, or whatever it is.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>