0

As I know, we can send a signal SIGTERM to a process by pressing ctrl+c or by using pkill -f processName.

Also, when we reboot or shutdown, the kernel will send SIGTERM to each process too.

So I'm asking if we could distinguish these two cases? (as they are all SIGTERM, we can't distinguish them by the signal)

Maybe the kernel provides us some kind of API? such as bool isRebooting() or bool isShutdown()?

Yves
  • 3,291

0 Answers0