Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

SIGKILL init process (PID 1)

I'm facing a weird issue regarding sending signal 9 (SIGKILL) to the init process (PID 1). As you may know, SIGKILL can't be ignored via signal handlers. As I tried sending SIGKILL to init, I noticed that nothing was happening; init would not get terminated. Trying to figure out this behaviour, I decided to attach myself to the init process with strace too see more clearly what was happening. Now comes the weird part. If I'm "looking" at the init process with strace and send it SIGKILL, the system crashes.

My question is why is this happening? Why does the system crash when I look at the process and why does it not crash when I'm not? As I said, in both cases I send SIGKILL to init. Tested on CentOS 6.5, Debian 7 and Arch.

Answer*

Draft saved
Draft discarded

Required fields are marked with *

Cancel
5
  • BTW, On Debian 7, SIGSEGV doesn't crash the init. On Arch and CentOS, it does. Commented Jan 10, 2014 at 17:55
  • 4
    I'm afraid "Debian 7", "Arch", and "CentOS" all refer to such large bundles of diverse software of uncertain age that this is useless as a data point. Also, if you tried kill -SEGV 1, that tells you nothing about what happens for kernel-generated SIGSEGV, e.g. if init actually attempts to dereference an invalid pointer. Commented Jan 10, 2014 at 19:10
  • The second link got broken. And... I wonder what makes it specialcase PID 1 (default actions are not performed)?.. I posted my guess here. Commented Oct 13, 2024 at 11:31
  • 1
    @x-yuri Link corrected. Commented Oct 13, 2024 at 19:16
  • It seems like the only place where SIGNAL_UNKILLABLE is set is here, where a new process is created, and if pid == 1 SIGNAL_UNKILLABLE is set. Which supposedly confirms my guess. Or so it seems. Commented Oct 13, 2024 at 21:13