Skip to content

Implement a g_shutting_down flag in the session runner #106

Description

@kavau

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:daemonDaemon core: event loop, signal handling, main.c wiringcleanupCode quality, refactoring, simplification

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions