[LEDE-DEV] [PATCH] procd: fire events at instance respawn and failure
Zefir Kurtisi
zefir.kurtisi at neratec.com
Thu Oct 13 07:50:56 PDT 2016
In addition to the existing 'start' and 'stop',
this commit adds 'respawn' and 'fail' events
to allow system monitors to detect and handle
unstable processes.
Signed-off-by: Zefir Kurtisi <zefir.kurtisi at neratec.com>
---
service/instance.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/service/instance.c b/service/instance.c
index 8f7835a..b783966 100644
--- a/service/instance.c
+++ b/service/instance.c
@@ -526,7 +526,9 @@ instance_exit(struct uloop_process *p, int ret)
in->srv->name, in->name, in->respawn_count, runtime);
in->restart = in->respawn = 0;
in->halt = 1;
+ service_event("instance.fail", in->srv->name, in->name);
} else {
+ service_event("instance.respawn", in->srv->name, in->name);
uloop_timeout_set(&in->timeout, in->respawn_timeout * 1000);
}
}
--
2.7.4
More information about the Lede-dev
mailing list