Running systemd without being the PID 1 process is challenging due to the unique role PID 1 plays in a Linux system. As the first process started by the kernel, PID 1 is responsible for initializing the system and managing processes, including adopting orphaned processes and reaping zombie processes. systemd, designed to handle these responsibilities, requires being PID 1 to function correctly. If systemd is not PID 1, it becomes difficult to manage system services unless another instance of systemd occupies the PID 1 slot.
Nitro Enclaves use a minimal init.c program as PID 1. This simple program handles essential tasks like starting necessary processes and remains minimal to maintain a small attack surface. Therefore, programs within enclaves shouldn’t rely on systemd for service management, as the minimal init.c does not provide the extensive service management capabilities of systemd.
In summary, while systemd requires being PID 1 to work properly, Nitro Enclaves use a stripped-down init.c as PID 1, providing just enough functionality to get things started and maintain security in their specialized environment. This setup implies that programs running within enclaves should avoid using systemd for service management.