confd: Avoid futile attempts to reload finit's config during boot

finit is not ready to accept the messages anyway, so we end up waiting
for the 2s timeout (2 times). Since finit won't setup a utmp entry
until it leaves runlevel S, we use that as the sync point for when
finit is ready to receive reloads.
This commit is contained in:
Tobias Waldekranz
2023-05-12 14:24:41 +02:00
committed by Joachim Wiberg
parent 3ae4e1d9ca
commit 751b22f4db
+4
View File
@@ -17,6 +17,10 @@ static int startup_save_hook(sr_session_ctx_t *session, uint32_t sub_id, const c
static int commit_done_hook(sr_session_ctx_t *session, uint32_t sub_id, const char *module,
const char *xpath, sr_event_t event, unsigned request_id, void *priv)
{
/* No need to reload if the system is still bootstrapping. */
if (system("runlevel >/dev/null"))
return SR_ERR_OK;
if (system("initctl -nbq reload"))
return SR_ERR_SYS;