keventd: add passive mode (-p) for coexistence with hotplug plugin

This is a backwards compatible mode for users upgrading and not noticing
that keventd is now build by default.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-08-16 22:03:30 +02:00
1 parent 8e91bb4297
commit db5567b5d1
3 files changed
+54 -32

No files matched your search

+12 -4
View File
@@ -2683,15 +2683,23 @@ int conf_init(uev_ctx_t *ctx)
}
#endif
/*
* Start kernel event daemon as soon as possible, if enabled
* Start kernel event daemon as soon as possible, if enabled.
* In passive mode (-p) alongside the hotplug plugin, keventd
* only monitors power supply events (sys/pwr/ac condition).
*/
if (whichp(FINIT_EXECPATH_ "/keventd"))
conf_save_service(SVC_TYPE_SERVICE, "keventd", "keventd.conf",
"\tdescription = \"Finit kernel event daemon\"\n"
"\trunlevel = \"S12345789\"\n"
"\tdescription = \"kernel event daemon\"\n"
"\trunlevel = \"S0123456789\"\n"
"\tnotify = \"none\"\n"
"\tcgroup init {}\n"
"\tcommand = \"" FINIT_EXECPATH_ "/keventd\"\n");
"\tcommand = \"" FINIT_EXECPATH_ "/keventd"
#ifdef HAVE_HOTPLUG_PLUGIN
" -p"
#else
" -c"
#endif
"\"\n");
dbg("Allow plugins to register early runlevel 1 run/task/services ...");
plugin_run_hooks(HOOK_SVC_PLUGIN);