confd: background factory reset to allow time to respond to RPC

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2024-06-04 13:38:03 +02:00
committed by Mattias Walström
parent 37506bcdd9
commit 310563abda
+7 -1
View File
@@ -6,8 +6,14 @@ static int factory_reset(sr_session_ctx_t *session, uint32_t sub_id, const char
const sr_val_t *input, const size_t input_cnt, sr_event_t event,
unsigned request_id, sr_val_t **output, size_t *output_cnt, void *priv)
{
char *args[] = { "factory", "-y", NULL };
DEBUG("%s", xpath);
return systemf("factory -y");
if (runbg(args, 500) == -1)
return SR_ERR_INTERNAL;
return 0;
}
int ietf_factory_default_init(struct confd *confd)