summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/service.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/service.c b/src/core/service.c
index 67920248d3..98b1599a32 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -2651,6 +2651,9 @@ static int service_serialize(Unit *u, FILE *f, FDSet *fds) {
if (s->exec_context.var_tmp_dir)
unit_serialize_item(u, f, "var-tmp-dir", s->exec_context.var_tmp_dir);
+ if (s->forbid_restart)
+ unit_serialize_item(u, f, "forbid_restart", yes_no(s->forbid_restart));
+
return 0;
}
@@ -2787,6 +2790,14 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
return log_oom();
s->exec_context.var_tmp_dir = t;
+ } else if (streq(key, "forbid_restart")) {
+ int b;
+
+ b = parse_boolean(value);
+ if (b < 0)
+ log_debug_unit(u->id, "Failed to parse forbid_restart value %s", value);
+ else
+ s->forbid_restart = b;
} else
log_debug_unit(u->id, "Unknown serialization key '%s'", key);