0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

SIGTERM, SIGKILLの違い

Posted at

sample.sh稼働中

[linuxstudy@xxxx ~]$ ps -el | grep samp
0 S  1000  30327  29828  0  80   0 - 28321 do_wai pts/2    00:00:00 sample.sh
[linuxstudy@xxxx ~]$ kill -SIGTERM 30327
[linuxstudy@xxxx ~]$ ps -el | grep samp      //SIGTERMで消滅

sample.sh一時停止

[linuxstudy@xxxx ~]$ ps -el | grep samp
0 T  1000  30399  29828  0  80   0 - 28321 do_sig pts/2    00:00:00 sample.sh
[linuxstudy@xxxx ~]$ kill -SIGTERM 30399
[linuxstudy@xxxx ~]$ ps -el | grep samp    //SIGTERMでは消滅しない
0 T  1000  30399  29828  0  80   0 - 28321 do_sig pts/2    00:00:00 sample.sh
[linuxstudy@xxxx ~]$ kill -SIGKILL 30399
[linuxstudy@xxxx ~]$ ps -el | grep samp    //SIGKILLにより強制消滅

数字でシグナル指定

[linuxstudy@xxxx ~]$ ps -el | grep samp
0 T  1000  30523  29828  0  80   0 - 28321 do_sig pts/2    00:00:00 sample.sh
[linuxstudy@xxxx ~]$ kill -15 30523
[linuxstudy@xxxx ~]$ ps -el | grep samp   //-15(SIGTERM)で消滅しない
0 T  1000  30523  29828  0  80   0 - 28321 do_sig pts/2    00:00:00 sample.sh
[linuxstudy@xxxx ~]$ kill -9 30523     //-9(SIGKILL)により強制消滅
[linuxstudy@xxxx ~]$ ps -el | grep samp
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?