summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-07-17 18:50:01 +0200
committerLennart Poettering <lennart@poettering.net>2018-07-23 13:36:47 +0200
commit42cb05d5ff71e2126a35bfbc55376bda231cfc38 (patch)
tree6bdad0b91d0f6e47beca3103777fcd2d1807f93e /src/core
parentee39ca20c6da8b77a647e45bbc7d6ec0b852888f (diff)
downloadsystemd-42cb05d5ff71e2126a35bfbc55376bda231cfc38.tar.gz
systemd-42cb05d5ff71e2126a35bfbc55376bda231cfc38.tar.bz2
systemd-42cb05d5ff71e2126a35bfbc55376bda231cfc38.zip
execute: document what the different structures are for in comments
Diffstat (limited to 'src/core')
-rw-r--r--src/core/execute.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/core/execute.h b/src/core/execute.h
index 81a118c5cd..bc832eebf0 100644
--- a/src/core/execute.h
+++ b/src/core/execute.h
@@ -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;