0

Today I was messing around with my computer and wondered what would happen if I killed init. I tried kill 1, nothing happened. I tried kill -9 1, nothing happened. I tried many very fatal signals, and all of them were ignored. I was finally able to attach to it with gdb and kill it that way. Now that I have killed PID 1, init, I want to kill PID 0, the kernel scheduler. How would I go about doing this? gdb can't find the process so that method is out and I am stumped.

Also, yes, I know there is absolutely no practical purpose of doing this but this is just a PC, I trust the journaling capabilities of ext4 and I have backups, so I just want to mess around with it (and maybe learn a bit about the Linux kernel in the process.)

This is on Ubuntu 20.04.

Ege F
  • 13
  • 3

1 Answers1

1

The kernel scheduler isn’t a separate process, you can’t stop it like that. See What's the process scheduler in Linux? for details.

To stop the kernel, you need to make the system panic; Does sysrq work when the kernel panic occurs? describes one way of doing that.

Stephen Kitt
  • 434,908