リビジョン | d5fcea9f58d85400164b77c77235b9d5e40ffee6 (tree) |
---|---|
日時 | 2019-03-28 19:36:05 |
作者 | Chih-Wei Huang <cwhuang@linu...> |
コミッター | Chih-Wei Huang |
init: handle ctrl-alt-del event
By setting /proc/sys/kernel/ctrl-alt-del to 1, kernel will trap
ctrl-alt-del event and send a SIGINT signal to init.
Start the ctrl-alt-del service on receiving the signal.
@@ -490,6 +490,12 @@ static void InstallRebootSignalHandlers() { | ||
490 | 490 | #endif |
491 | 491 | sigaction(SIGSYS, &action, nullptr); |
492 | 492 | sigaction(SIGTRAP, &action, nullptr); |
493 | + | |
494 | + action.sa_handler = [](int sig) { | |
495 | + LOG(INFO) << "Got ctrl-alt-del: " << sig; | |
496 | + HandleControlMessage("start", "ctrl-alt-del", getpid()); | |
497 | + }; | |
498 | + sigaction(SIGINT, &action, nullptr); | |
493 | 499 | } |
494 | 500 | |
495 | 501 | static void HandleSigtermSignal() { |