chiark / gitweb /
support chrooting/setting of ioprio when spawning
[elogind.git] / execute.h
index e9bd686876d44900ec0bf0514671d79b3b160389..581736d0f5cc5c540cc32d05f6ca1cf75c361242 100644 (file)
--- a/execute.h
+++ b/execute.h
@@ -16,6 +16,16 @@ typedef struct ExecContext ExecContext;
 #include "list.h"
 #include "util.h"
 
+/* Abstract namespace! */
+#define LOGGER_SOCKET "/systemd/logger"
+
+typedef enum ExecOutput {
+        EXEC_CONSOLE,
+        EXEC_NULL,
+        EXEC_SYSLOG,
+        EXEC_KERNEL
+} ExecOutput;
+
 struct ExecStatus {
         pid_t pid;
         usec_t timestamp;
@@ -33,11 +43,21 @@ struct ExecCommand {
 struct ExecContext {
         char **environment;
         mode_t umask;
-        struct rlimit *rlimit[RLIMIT_NLIMITS];
+        struct rlimit *rlimit[RLIMIT_NLIMITS];  /* FIXME: load-fragment parser missing */
+        char *working_directory, *root_directory;
         int oom_adjust;
         int nice;
-        char *directory;
+        int ioprio;
+
+        bool oom_adjust_set:1;
+        bool nice_set:1;
+        bool ioprio_set:1;
 
+        ExecOutput output;
+        int syslog_priority;
+        char *syslog_identifier;
+
+         /* FIXME: all privs related settings need parser and enforcer */
         cap_t capabilities;
         bool capabilities_set:1;
 
@@ -71,7 +91,12 @@ typedef enum ExitStatus {
         EXIT_EXEC,
         EXIT_MEMORY,
         EXIT_LIMITS,
-        EXIT_OOM_ADJUST
+        EXIT_OOM_ADJUST,
+        EXIT_SIGNAL_MASK,
+        EXIT_OUTPUT,
+        EXIT_CHROOT,
+        EXIT_PGID,
+        EXIT_IOPRIO
 } ExitStatus;
 
 int exec_spawn(const ExecCommand *command, const ExecContext *context, int *fds, unsigned n_fds, pid_t *ret);
@@ -79,6 +104,10 @@ int exec_spawn(const ExecCommand *command, const ExecContext *context, int *fds,
 void exec_command_free_list(ExecCommand *c);
 void exec_command_free_array(ExecCommand **c, unsigned n);
 
+char *exec_command_line(ExecCommand *c);
+void exec_command_dump(ExecCommand *c, FILE *f, const char *prefix);
+void exec_command_dump_list(ExecCommand *c, FILE *f, const char *prefix);
+
 void exec_context_init(ExecContext *c);
 void exec_context_done(ExecContext *c);
 void exec_context_dump(ExecContext *c, FILE* f, const char *prefix);