syslog: fix incorrect use of sizeof() in vsnprintf()
[project/procd.git] / instance.h
index ceae834..6e69086 100644 (file)
@@ -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;
+
+       uint32_t respawn_timeout;
+       uint32_t respawn_threshold;
+       uint32_t 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);