diff options
author | John Crispin <blogic@openwrt.org> | 2013-08-27 11:41:11 +0200 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2013-09-03 19:42:44 +0200 |
commit | f0b6ea93233ba5134311352595969797b00a98de (patch) | |
tree | 248321a9b1d9a3c9cdf511ff413aa446967fb3f2 /instance.h | |
parent | 1c01a5137402cfd1bc7557118401f3b90c305b78 (diff) | |
download | unitd-f0b6ea93233ba5134311352595969797b00a98de.tar unitd-f0b6ea93233ba5134311352595969797b00a98de.zip |
add respawn handling
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'instance.h')
-rw-r--r-- | instance.h | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -19,6 +19,8 @@ #include <libubox/uloop.h> #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); |