From f0b6ea93233ba5134311352595969797b00a98de Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 27 Aug 2013 11:41:11 +0200 Subject: add respawn handling Signed-off-by: John Crispin --- instance.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'instance.h') diff --git a/instance.h b/instance.h index ceae834..1c8c0a0 100644 --- a/instance.h +++ b/instance.h @@ -19,6 +19,8 @@ #include #include "utils.h" +#define RESPAWN_ERROR (5 * 60) + struct service_instance { struct vlist_node node; struct service *srv; @@ -26,7 +28,16 @@ struct service_instance { int8_t nice; bool valid; + + bool halt; bool restart; + bool respawn; + int respawn_count; + struct timespec start; + + int respawn_timeout; + int respawn_threshold; + int respawn_retry; struct blob_attr *config; struct uloop_process proc; @@ -41,7 +52,7 @@ struct service_instance { }; void instance_start(struct service_instance *in); -void instance_stop(struct service_instance *in, bool restart); +void instance_stop(struct service_instance *in); bool instance_update(struct service_instance *in, struct service_instance *in_new); void instance_init(struct service_instance *in, struct service *s, struct blob_attr *config); void instance_free(struct service_instance *in); -- cgit v1.2.3