]>
git.ipfire.org Git - thirdparty/systemd.git/blob - execute.h
1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
6 typedef struct ExecStatus ExecStatus
;
7 typedef struct ExecCommand ExecCommand
;
8 typedef struct ExecContext ExecContext
;
11 #include <sys/resource.h>
12 #include <sys/capability.h>
19 /* Abstract namespace! */
20 #define LOGGER_SOCKET "/systemd/logger"
22 typedef enum ExecOutput
{
32 int code
; /* as in siginfo_t::si_code */
33 int status
; /* as in sigingo_t::si_status */
39 ExecStatus exec_status
;
40 LIST_FIELDS(ExecCommand
, command
); /* useful for chaining commands */
46 struct rlimit
*rlimit
[RLIMIT_NLIMITS
]; /* FIXME: load-fragment parser missing */
51 bool oom_adjust_set
:1;
56 char *syslog_identifier
;
58 /* FIXME: all privs related settings need parser and enforcer */
60 bool capabilities_set
:1;
62 /* since resolving these names might might involve socket
63 * connections and we don't want to deadlock ourselves these
64 * names are resolved on execution only. */
67 char **supplementary_groups
;
70 typedef enum ExitStatus
{
71 /* EXIT_SUCCESS defined by libc */
72 /* EXIT_FAILURE defined by libc */
73 EXIT_INVALIDARGUMENT
= 2,
74 EXIT_NOTIMPLEMENTED
= 3,
75 EXIT_NOPERMISSION
= 4,
76 EXIT_NOTINSTALLED
= 5,
77 EXIT_NOTCONFIGURED
= 6,
80 /* The LSB suggests that error codes >= 200 are "reserved". We
81 * use them here under the assumption that they hence are
82 * unused by init scripts.
84 * http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html */
97 int exec_spawn(const ExecCommand
*command
, const ExecContext
*context
, int *fds
, unsigned n_fds
, pid_t
*ret
);
99 void exec_command_free_list(ExecCommand
*c
);
100 void exec_command_free_array(ExecCommand
**c
, unsigned n
);
102 char *exec_command_line(ExecCommand
*c
);
103 void exec_command_dump(ExecCommand
*c
, FILE *f
, const char *prefix
);
104 void exec_command_dump_list(ExecCommand
*c
, FILE *f
, const char *prefix
);
106 void exec_context_init(ExecContext
*c
);
107 void exec_context_done(ExecContext
*c
);
108 void exec_context_dump(ExecContext
*c
, FILE* f
, const char *prefix
);
110 void exec_status_fill(ExecStatus
*s
, pid_t pid
, int code
, int status
);