The Special Case of PID 1
I was testing some things on our kubernetes cluster and wanted to quickly restart the k8s container without restarting the pod and having to wait for the graceful termination period. So I exec'd into the container and sent a signal to PID 1 ( kill -15 1 ) and expected the process to terminate while kicking me out of the container. Much to my surprise, it did absolutely nothing. I thought, hey, maybe for some reason it's hanging, let's give it a few seconds... A few seconds passed and still nothing happened. Okay, perhaps something is causing it to not properly process the signals, so I sent a SIGKILL ( -9 ) as those cannot be intercepted or processed in any way . Even that didn't kill the process. I was flabbergasted. Did we find a bug in the kernel, or did we find a way to make an unkillable process? I decided to put a strace on the process from the host machine to see if there's any insight. At first I saw it was receiving the...