Add optional feature to notify status to systemd#448
Add optional feature to notify status to systemd#448joggee-fr wants to merge 1 commit intocage-kiosk:masterfrom
Conversation
When enabled, the feature uses libsystemd to notify service manager about the following states: - ready - periodic alive ping (20s) - stopping It allows to use Cage in a systemd unit with following options: Type=notify WatchdogSec=30s
|
In general I don't really like adding systemd-specific logic to software. |
|
I understand, however it looks to me that is the more efficient way for Cage to be integrated as a systemd service unit. The main case I encountered is, in an embedded Linux custom distribution, start the main graphical application when the Wayland composer is ready. It avoids temporary failures because of not yet existing Wayland socket. And the application is expected to run with its own user, not as the So with these modifications, the application service unit can use efficiently the description below as we know the Wayland socket will be ready when starting. Of course, there are, like always, plenty of other solutions but I didn't find one as easy as to integrate systemd logic in Cage itself. For information, on its side, Weston composer uses a dedicated plugin named One last point, integrating systemd in Cage (with a tiny abstraction) allows to add ping to software watchdog directly in the main loop. Using the same abstraction, we certainly could support later other process supervisor. |
Would socket activation be more appropriate here? See swaywm/sway#8259
FWIW, it should be possible to exec |
I made some tests and could be a reliable solution to manage dependencies. |
When enabled, the feature uses libsystemd to notify service manager about the following states:
It allows to use Cage in a systemd unit with following options: