cage/notify.h
Jonathan GUILLOT a500d11f0f Add optional feature to notify status to systemd
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
2025-09-10 22:49:09 +02:00

24 lines
346 B
C

#ifndef CG_NOTIFY_H
#define CG_NOTIFY_H
#include "config.h"
#define CAGE_ALIVE_PERIOD_MS (20000)
enum cg_notify_state {
CAGE_READY,
CAGE_ALIVE,
CAGE_STOPPING,
};
#if !CAGE_HAS_SYSTEMD
static inline void
notify_set_state(enum cg_notify_state state)
{
/* Nothing */
}
#else
void notify_set_state(enum cg_notify_state state);
#endif
#endif