Chinaunix

标题: "kill" command. [打印本页]

作者: Ken123    时间: 2003-05-04 16:37
标题: "kill" command.
what is the diffenence between the following two commands:

1) kill -1 pid
2) kill -HUP pid

thx all.
作者: 疯狂钻石    时间: 2003-05-04 16:42
标题: "kill" command.
if you chage any daemon's configuration , e.g, inetd.conf or Apache httpd.conf and want it work using new configuration immediately. you can use the second command

kill -9 pid
this is kill the process by force. it is useful
作者: JohnBull    时间: 2003-05-04 18:19
标题: "kill" command.
kill命令的字面意思容易让人发生误会。
kill命令的本质实际上是“向指定进程发送一个信号”(man kill)
它的语法就是
kill [信号说明] 进程编号
如果省略信号说明部分,kill就会发送SIHTERM信号。

每个程序都可以自己定义收到某个信号时采取什么措施(man signal),除了SIGKILL等个别信号之外。某些程序定义了SIGHUP信号的动作是重新读取配置文件,但切不可随意推而广之,SIGHUP信号的缺省动作与SIGTERM是一样的,都是结束程序执行。

在Linux下,描述信号的方法最好还是用文字(如-SIGTERM/-SIGHUP/……)而不是用他们的编号(如-3/-9),这样有助于学习。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2