chiark / gitweb /
core: open up DefaultDependencies= property for transient units
authorLennart Poettering <lennart@poettering.net>
Tue, 3 Feb 2015 18:07:40 +0000 (19:07 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 3 Feb 2015 18:07:40 +0000 (19:07 +0100)
src/core/dbus-unit.c
src/libsystemd/sd-bus/bus-util.c

index fe876b3ffe69316604b2342fe4c17c8044a19ee9..625d21ab8b10db2f822fc8ced678b38a4fc1a745 100644 (file)
@@ -898,6 +898,20 @@ static int bus_unit_set_transient_property(
 
                 return 1;
 
+        } else if (streq(name, "DefaultDependencies")) {
+                int b;
+
+                r = sd_bus_message_read(message, "b", &b);
+                if (r < 0)
+                        return r;
+
+                if (mode != UNIT_CHECK) {
+                        u->default_dependencies = b;
+                        unit_write_drop_in_format(u, mode, name, "[Unit]\nDefaultDependencies=%s\n", yes_no(b));
+                }
+
+                return 1;
+
         } else if (streq(name, "Slice") && unit_get_cgroup_context(u)) {
                 const char *s;
 
index bb08e387c44ce2d9e89a025337e613149c5f4ce8..c9d8713b25cade2e8ec3f01f8213805526daaefe 100644 (file)
@@ -1371,8 +1371,7 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
 
         if (STR_IN_SET(field,
                        "CPUAccounting", "MemoryAccounting", "BlockIOAccounting",
-                       "SendSIGHUP", "SendSIGKILL",
-                       "WakeSystem")) {
+                       "SendSIGHUP", "SendSIGKILL", "WakeSystem", "DefaultDependencies")) {
 
                 r = parse_boolean(eq);
                 if (r < 0) {