summaryrefslogtreecommitdiff
path: root/docs/ARCHITECTURE.md
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2021-09-13 15:57:54 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2021-09-14 13:55:05 +0100
commit76ab98fa2b221576c81d13c69cfe4cad5bcd23e4 (patch)
treea34803e60540e4a376ccf40b8654673e5f36aa48 /docs/ARCHITECTURE.md
parentc4f06a75ea7e49b950d93501660fb744cf39fd6b (diff)
downloadsystemd-76ab98fa2b221576c81d13c69cfe4cad5bcd23e4.tar.gz
docs: generic info about adding directives in ARCHITECTURE.md
Diffstat (limited to 'docs/ARCHITECTURE.md')
-rw-r--r--docs/ARCHITECTURE.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
index 31b63b4948..5684911fd3 100644
--- a/docs/ARCHITECTURE.md
+++ b/docs/ARCHITECTURE.md
@@ -50,6 +50,28 @@ service manager.
BPF helpers written in C and used by PID 1 can be found under `src/core/bpf/`.
+### Implementing Unit Settings
+
+The system and session manager supports a large number of unit settings. These can generally
+be configured in three ways:
+
+1. Via textual, INI-style configuration files called *unit* *files*
+2. Via D-Bus messages to the manager
+3. Via the `systemd-run` and `systemctl set-property` commands
+
+From a user's perspective, the third is a wrapper for the second. To implement a new unit
+setting, it is necessary to support all three input methods:
+
+1. *unit* *files* are parsed in `src/core/load-fragment.c`, with many simple and fixed-type
+unit settings being parsed by common helpers, with the definition in the generator file
+`src/core/load-fragment-gperf.gperf.in`
+2. D-Bus messages are defined and parsed in `src/core/dbus-*.c`
+3. `systemd-run` and `systemctl set-property` do client-side parsing and translating into
+D-Bus messages in `src/shared/bus-unit-util.c`
+
+So that they are exercised by the fuzzing CI, new unit settings should also be listed in the
+text files under `test/fuzz/fuzz-unit-file/`.
+
## UDEV
Sources for the udev daemon and command-line tool (single binary) can be found under