sisungo / airup

🚀 Airup is a modern, portable and blazingly fast implementation of service supervisor and the init daemon.
MIT License
18 stars 1 forks source link

Avoid terminations when being `pid == 1` #23

Closed sisungo closed 5 months ago

sisungo commented 9 months ago

Currently, airupd will terminate if signals like SIGSEGV or SIGABRT are sent to the daemon, which usually causes a kernel panic. We should register signal handlers for them to avoid terminations. The signal handlers are simple enough, so they don't lead to UBs.

The signal handler should first try to execve:

airup debug --daemon-crash-handler

If the operation failed, try to execve on /bin/sh.

If all the above operations failed, do infinity spin loops.

This introduces a new airup debug utility, --daemon-crash-handler. This should also keep simple. The crash handler should:

hetaodo commented 8 months ago

You're so good, sisungo

sisungo commented 7 months ago

Priority: Low.