signal一般用來實現優雅重啟,或者重新載入配置檔案等操作。
廢話不多說,上表格
動作 | 號碼 | 訊號 | golang |
---|---|---|---|
kill pid | 15 | SIGTERM | terminated |
kill -9 pid | 9 | SIGKILL | killed (應用程式無法捕獲) |
kill -10 pid | 10 | SIGUSR1 | user defined signal 1 |
kill -12 pid | 12 | SIGUSR2 | user defined signal 2 |
ctrl+c | 2 | SIGINT | interrupt |
ctrl+z | 20 | SIGTSTP | stopped |
ctrl+ | 3 | SIGQUIT | quit |
kill -1 pid | 1 | SIGHUP | operation not permitted (一般用來重新載入配置檔案) |
參考:
http://www.cnblogs.com/jkkkk/p/6180016.html
http://blog.csdn.net/zzhongcy/article/details/50601079
http://os.51cto.com/art/201006/203953.htm