instance: add 'requirejail' attribute
[oweals/procd.git] / service / instance.h
index 770000001b62c993d5a6902bbe685d127d0df5ca..003a8c999d0e66b4c30c9f6c58624bbb0ef9f2f5 100644 (file)
@@ -21,6 +21,7 @@
 #include "../utils/utils.h"
 
 #define RESPAWN_ERROR  (5 * 60)
+#define SIGNALLED_OFFSET 128
 
 struct jail {
        bool procfs;
@@ -28,7 +29,9 @@ struct jail {
        bool ubus;
        bool log;
        bool ronly;
+       bool netns;
        char *name;
+       char *hostname;
        struct blobmsg_list mount;
        int argc;
 };
@@ -41,21 +44,30 @@ 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;
+       int syslog_facility;
+       int exit_code;
 
+       uint32_t term_timeout;
        uint32_t respawn_timeout;
        uint32_t respawn_threshold;
        uint32_t respawn_retry;
@@ -77,8 +89,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);