trigger: fix memory leak in script calls
[project/procd.git] / service / instance.h
index f76e795..7490462 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;
@@ -38,6 +51,12 @@ struct service_instance {
        int respawn_count;
        struct timespec start;
 
+       bool trace;
+       bool has_jail;
+       bool no_new_privs;
+       struct jail jail;
+       char *seccomp;
+
        uint32_t respawn_timeout;
        uint32_t respawn_threshold;
        uint32_t respawn_retry;
@@ -45,6 +64,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;