core: add two new unit file settings: StandardInputData= + StandardInputText=
Both permit configuring data to pass through STDIN to an invoked process. StandardInputText= accepts a line of text (possibly with embedded C-style escapes as well as unit specifiers), which is appended to the buffer to pass as stdin, followed by a single newline. StandardInputData= is similar, but accepts arbitrary base64 encoded data, and will not resolve specifiers or C-style escapes, nor append newlines. This may be used to pass input/configuration data to services, directly in-line from unit files, either in a cooked or in a more raw format.
This commit is contained in:
@@ -37,6 +37,8 @@ typedef struct ExecParameters ExecParameters;
|
||||
#include "namespace.h"
|
||||
#include "nsflags.h"
|
||||
|
||||
#define EXEC_STDIN_DATA_MAX (64U*1024U*1024U)
|
||||
|
||||
typedef enum ExecUtmpMode {
|
||||
EXEC_UTMP_INIT,
|
||||
EXEC_UTMP_LOGIN,
|
||||
@@ -52,6 +54,7 @@ typedef enum ExecInput {
|
||||
EXEC_INPUT_TTY_FAIL,
|
||||
EXEC_INPUT_SOCKET,
|
||||
EXEC_INPUT_NAMED_FD,
|
||||
EXEC_INPUT_DATA,
|
||||
_EXEC_INPUT_MAX,
|
||||
_EXEC_INPUT_INVALID = -1
|
||||
} ExecInput;
|
||||
@@ -163,6 +166,9 @@ struct ExecContext {
|
||||
ExecOutput std_error;
|
||||
char *stdio_fdname[3];
|
||||
|
||||
void *stdin_data;
|
||||
size_t stdin_data_size;
|
||||
|
||||
nsec_t timer_slack_nsec;
|
||||
|
||||
bool stdio_as_fds;
|
||||
|
||||
Reference in New Issue
Block a user