summaryrefslogtreecommitdiffstats
path: root/src/core/scope.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-11-23 12:51:54 +0100
committerLennart Poettering <lennart@poettering.net>2017-11-23 21:47:48 +0100
commit33fe0afe9af56af67ab72cf407cb41a8628e0e06 (patch)
tree158e7c9865a29a591fb4397d78f6cfce0b886175 /src/core/scope.c
parentman: reorder/add sections to systemd.exec(5) (#7412) (diff)
downloadsystemd-33fe0afe9af56af67ab72cf407cb41a8628e0e06.tar.xz
systemd-33fe0afe9af56af67ab72cf407cb41a8628e0e06.zip
core: serialize the "controller" field in scope units
We forgot to serialize it previously, hence daemon reload flushed it out, since we also didn't write it to any unit file...
Diffstat (limited to 'src/core/scope.c')
-rw-r--r--src/core/scope.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/scope.c b/src/core/scope.c
index 444c00be92..05b2ec31d1 100644
--- a/src/core/scope.c
+++ b/src/core/scope.c
@@ -411,11 +411,16 @@ static int scope_serialize(Unit *u, FILE *f, FDSet *fds) {
unit_serialize_item(u, f, "state", scope_state_to_string(s->state));
unit_serialize_item(u, f, "was-abandoned", yes_no(s->was_abandoned));
+
+ if (s->controller)
+ unit_serialize_item(u, f, "controller", s->controller);
+
return 0;
}
static int scope_deserialize_item(Unit *u, const char *key, const char *value, FDSet *fds) {
Scope *s = SCOPE(u);
+ int r;
assert(u);
assert(key);
@@ -439,6 +444,12 @@ static int scope_deserialize_item(Unit *u, const char *key, const char *value, F
log_unit_debug(u, "Failed to parse boolean value: %s", value);
else
s->was_abandoned = k;
+ } else if (streq(key, "controller")) {
+
+ r = free_and_strdup(&s->controller, value);
+ if (r < 0)
+ log_oom();
+
} else
log_unit_debug(u, "Unknown serialization key: %s", key);