]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/dbus-service: write PIDFile= setting to transient unit file
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 6 Feb 2019 16:44:59 +0000 (17:44 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 6 Feb 2019 16:58:40 +0000 (17:58 +0100)
Follow-up for a9353a5c5b512f107955e56a9812724f40b841d3.

src/core/dbus-service.c

index ec61ea2772f8651ef7389fc9409b3ed6f17c2a63..10470a3f70ec4d8818c8ca390d0f673e67518f31 100644 (file)
@@ -340,9 +340,13 @@ static int bus_service_set_transient_property(
                         if (!UNIT_WRITE_FLAGS_NOOP(flags))
                                 log_unit_notice(u, "Transient unit's PIDFile= property references path below legacy directory /var/run, updating %s → %s; please update client accordingly.", n, z);
 
-                        free_and_replace(s->pid_file, z);
-                } else
+                        free_and_replace(n, z);
+                }
+
+                if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
                         free_and_replace(s->pid_file, n);
+                        unit_write_settingf(u, flags, name, "%s=%s", name, s->pid_file);
+                }
 
                 return 1;
         }