summaryrefslogtreecommitdiff
path: root/src/core/execute.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-10-27 16:09:57 +0200
committerLennart Poettering <lennart@poettering.net>2017-11-17 11:13:44 +0100
commit2038c3f58486ea5da1a2fbf2fdb898f9fd6f8cae (patch)
tree71b68c25f17a129f9e419e80120a0d6185f51828 /src/core/execute.h
parent0664775c846f4ff1b53ee6e93d5a1aef68912dad (diff)
downloadsystemd-2038c3f58486ea5da1a2fbf2fdb898f9fd6f8cae.tar.gz
core: add support for StandardInputFile= and friends
These new settings permit specifiying arbitrary paths as stdin/stdout/stderr locations. We try to open/create them as necessary. Some special magic is applied: 1) if the same path is specified for both input and output/stderr, we'll open it only once O_RDWR, and duplicate them fd instead. 2) If we an AF_UNIX socket path is specified, we'll connect() to it, rather than open() it. This allows invoking systemd services with stdin/stdout/stderr connected to arbitrary foreign service sockets. Fixes: #3991
Diffstat (limited to 'src/core/execute.h')
-rw-r--r--src/core/execute.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/execute.h b/src/core/execute.h
index d1cf7dca93..2ae38aa222 100644
--- a/src/core/execute.h
+++ b/src/core/execute.h
@@ -55,6 +55,7 @@ typedef enum ExecInput {
EXEC_INPUT_SOCKET,
EXEC_INPUT_NAMED_FD,
EXEC_INPUT_DATA,
+ EXEC_INPUT_FILE,
_EXEC_INPUT_MAX,
_EXEC_INPUT_INVALID = -1
} ExecInput;
@@ -71,6 +72,7 @@ typedef enum ExecOutput {
EXEC_OUTPUT_JOURNAL_AND_CONSOLE,
EXEC_OUTPUT_SOCKET,
EXEC_OUTPUT_NAMED_FD,
+ EXEC_OUTPUT_FILE,
_EXEC_OUTPUT_MAX,
_EXEC_OUTPUT_INVALID = -1
} ExecOutput;
@@ -165,6 +167,7 @@ struct ExecContext {
ExecOutput std_output;
ExecOutput std_error;
char *stdio_fdname[3];
+ char *stdio_file[3];
void *stdin_data;
size_t stdin_data_size;