News for hackers. Stuff that matters.
Re:Why not kill -9 a process? by jdubs on Tuesday January 28, 2014 @12:11AM (#7135457)
kill = send a signal.

By far the easiest question to weed out inexperienced linux users.

Re:Why not kill -9 a process? by ababab on Tuesday January 28, 2014 @12:18AM (#7135485)
Shouldn't that explanation be by followed by 'in order to request the termination of the process'?
Re:Why not kill -9 a process? by habosa on Tuesday January 28, 2014 @12:24AM (#7135503)
Not always. The kill system call can be used to send any signal, it's just got a name that implies you're sending something like SIGKILL or SIGTERM. I have written C programs that use kill for harmless inter-process communication.
Re:Why not kill -9 a process? by eru on Tuesday January 28, 2014 @12:46AM (#7135573)
SIGUSER is quite common for that. Or SIGHUP.
Re:Why not kill -9 a process? by brokenparser on Tuesday January 28, 2014 @02:31AM (#7135874)
By convention, SIGHUP is used by daemons to signal a change of configuration.
Re:Why not kill -9 a process? by beedogs on Tuesday January 28, 2014 @12:21AM (#7135496)
Not necessarily. You can send the CONTinue signal to a process using the kill command. This will not cause the process to terminate.
Re:Why not kill -9 a process? by twinge on Tuesday January 28, 2014 @12:46AM (#7135572)
Or use "kill -0 <pid>" to check if a signal can be sent/the pid exists.
Re:Why not kill -9 a process? by rahimnathwani on Tuesday January 28, 2014 @01:07AM (#7135634)
Or use kill -USR1 <pid> to check the progress of dd
Re:Why not kill -9 a process? by DHowett on Tuesday January 28, 2014 @02:31AM (#7135879)
Only if you've enabled it. If you've not, the process will terminate unceremoniously (in a mechanism borne entirely out of hatred for users.)

This is my favourite part of dd: The "will I receive a status report or will I terminate my long-running copy?" gamble.

Re:Why not kill -9 a process? by jsight on Tuesday January 28, 2014 @09:31AM (#7137198)
Is that a BSD thing? I've never had to enable it on Linux to avoid killing the process.
Re:Why not kill -9 a process? by rahimnathwani on Tuesday January 28, 2014 @12:12PM (#7138249)
Me neither, on debian.
Re:Why not kill -9 a process? by Freaky on Tuesday January 28, 2014 @05:38AM (#7136354)
It's SIGINFO on the BSD's, and works with just about any process (though obviously not everything has a customized handler). Also handily mapped to Ctrl-T.
Re:Why not kill -9 a process? by brokenparser on Tuesday January 28, 2014 @02:28AM (#7135862)
No because only SIGQUIT, SIGABRT, SIGKILL, SIGTERM and often SIGHUP are supposed to do that. All of the other signals have wildly varying meanings. See man 7 signal: http://unixhelp.ed.ac.uk/CGI/man-cgi?signal+7
Re:Why not kill -9 a process? by nailer on Tuesday January 28, 2014 @01:11AM (#7135650)
You can also cancel (sigint, eg ctrl c) processes via kill.

Or use sigchld to a parent to get rid of zombie children.

Re:Why not kill -9 a process? by drivers99 on Tuesday January 28, 2014 @11:53AM (#7138139)
SIGHUP is also used to tell some certain daemons to re-read their configuration files without quitting.