jail: add support for userns and cgroupsns
[project/procd.git] / service / instance.h
index 3fb33e9b1cd7891018ae9e1f3f8b13bde6018ae7..7e80c61946516112bef33b6f2a96761f52d5d826 100644 (file)
 #include "../utils/utils.h"
 
 #define RESPAWN_ERROR  (5 * 60)
+#define SIGNALLED_OFFSET 128
 
 struct jail {
        bool procfs;
        bool sysfs;
        bool ubus;
        bool log;
+       bool ronly;
+       bool netns;
+       bool userns;
+       bool cgroupsns;
        char *name;
-       char *root;
+       char *hostname;
        struct blobmsg_list mount;
        int argc;
 };
@@ -41,20 +46,31 @@ struct service_instance {
        int8_t nice;
        bool valid;
 
+       char *user;
        uid_t uid;
-       gid_t gid;
+       gid_t pw_gid;
+       char *group;
+       gid_t gr_gid;
 
        bool halt;
        bool restart;
        bool respawn;
        int respawn_count;
+       int reload_signal;
        struct timespec start;
 
        bool trace;
        bool has_jail;
+       bool require_jail;
+       bool no_new_privs;
        struct jail jail;
        char *seccomp;
+       char *pidfile;
+       char *extroot;
+       int syslog_facility;
+       int exit_code;
 
+       uint32_t term_timeout;
        uint32_t respawn_timeout;
        uint32_t respawn_threshold;
        uint32_t respawn_retry;
@@ -76,8 +92,8 @@ 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_stop(struct service_instance *in, bool halt);
+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);