execute: document what the different structures are for in comments
This commit is contained in:
+13
-3
@@ -77,10 +77,11 @@ typedef enum ExecKeyringMode {
|
||||
_EXEC_KEYRING_MODE_INVALID = -1,
|
||||
} ExecKeyringMode;
|
||||
|
||||
/* Contains start and exit information about an executed command. */
|
||||
struct ExecStatus {
|
||||
pid_t pid;
|
||||
dual_timestamp start_timestamp;
|
||||
dual_timestamp exit_timestamp;
|
||||
pid_t pid;
|
||||
int code; /* as in siginfo_t::si_code */
|
||||
int status; /* as in sigingo_t::si_status */
|
||||
};
|
||||
@@ -92,6 +93,7 @@ typedef enum ExecCommandFlags {
|
||||
EXEC_COMMAND_AMBIENT_MAGIC = 8,
|
||||
} ExecCommandFlags;
|
||||
|
||||
/* Stores information about commands we execute. Covers both configuration settings as well as runtime data. */
|
||||
struct ExecCommand {
|
||||
char *path;
|
||||
char **argv;
|
||||
@@ -100,13 +102,16 @@ struct ExecCommand {
|
||||
LIST_FIELDS(ExecCommand, command); /* useful for chaining commands */
|
||||
};
|
||||
|
||||
/* Encapsulates certain aspects of the runtime environment that is to be shared between multiple otherwise separate
|
||||
* invocations of commands. Specifically, this allows sharing of /tmp and /var/tmp data as well as network namespaces
|
||||
* between invocations of commands. This is a reference counted object, with one reference taken by each currently
|
||||
* active command invocation that wants to share this runtime. */
|
||||
struct ExecRuntime {
|
||||
int n_ref;
|
||||
|
||||
Manager *manager;
|
||||
|
||||
/* unit id of the owner */
|
||||
char *id;
|
||||
char *id; /* Unit id of the owner */
|
||||
|
||||
char *tmp_dir;
|
||||
char *var_tmp_dir;
|
||||
@@ -131,6 +136,9 @@ typedef struct ExecDirectory {
|
||||
mode_t mode;
|
||||
} ExecDirectory;
|
||||
|
||||
/* Encodes configuration parameters applied to invoked commands. Does not carry runtime data, but only configuration
|
||||
* changes sourced from unit files and suchlike. ExecContext objects are usually embedded into Unit objects, and do not
|
||||
* change after being loaded. */
|
||||
struct ExecContext {
|
||||
char **environment;
|
||||
char **environment_files;
|
||||
@@ -291,6 +299,8 @@ typedef enum ExecFlags {
|
||||
EXEC_SET_WATCHDOG = 1 << 11,
|
||||
} ExecFlags;
|
||||
|
||||
/* Parameters for a specific invocation of a command. This structure is put together right before a command is
|
||||
* executed. */
|
||||
struct ExecParameters {
|
||||
char **environment;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user