When receiving SIGTERM, the session runner correctly handles the main cases:
- If the greeter is currently running, the runner will terminate it, which unblocks the event loop. The runner takes the error path and shuts down itself.
- If the compositor is currently running, the runner will terminate it, wait for it to die, and then exit itself.
The in-between states are less clear - g_child_pid == 0, so the SIGTERM will be ignored and the daemon can start a user session after receiving SIGTERM.
A proper fix is to add a g_shutting_down global, which is set by the SIGTERM handler, and which prevents the runner from doing anything other than cleanup.
When receiving SIGTERM, the session runner correctly handles the main cases:
The in-between states are less clear - g_child_pid == 0, so the SIGTERM will be ignored and the daemon can start a user session after receiving SIGTERM.
A proper fix is to add a
g_shutting_downglobal, which is set by the SIGTERM handler, and which prevents the runner from doing anything other than cleanup.