service: add reload_signal property
[project/procd.git] / service / instance.h
index f76e79573986c2f9b663681e23fd1bb299edb60f..3cc20093f810176e842920e197e2d336b4b712fe 100644 (file)
 
 #include <libubox/vlist.h>
 #include <libubox/uloop.h>
+#include <libubox/ustream.h>
 #include "../utils/utils.h"
 
 #define RESPAWN_ERROR  (5 * 60)
 
+struct jail {
+       bool procfs;
+       bool sysfs;
+       bool ubus;
+       bool log;
+       bool ronly;
+       char *name;
+       char *hostname;
+       struct blobmsg_list mount;
+       int argc;
+};
+
 struct service_instance {
        struct vlist_node node;
        struct service *srv;
@@ -36,8 +49,16 @@ struct service_instance {
        bool restart;
        bool respawn;
        int respawn_count;
+       int reload_signal;
        struct timespec start;
 
+       bool trace;
+       bool has_jail;
+       bool no_new_privs;
+       struct jail jail;
+       char *seccomp;
+       char *pidfile;
+
        uint32_t respawn_timeout;
        uint32_t respawn_threshold;
        uint32_t respawn_retry;
@@ -45,6 +66,8 @@ struct service_instance {
        struct blob_attr *config;
        struct uloop_process proc;
        struct uloop_timeout timeout;
+       struct ustream_fd _stdout;
+       struct ustream_fd _stderr;
 
        struct blob_attr *command;
        struct blob_attr *trigger;
@@ -58,7 +81,7 @@ struct service_instance {
 
 void instance_start(struct service_instance *in);
 void instance_stop(struct service_instance *in);
-bool instance_update(struct service_instance *in, struct service_instance *in_new);
+void 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);
 void instance_dump(struct blob_buf *b, struct service_instance *in, int debug);