summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-26 17:05:33 +0100
committerLennart Poettering <lennart@poettering.net>2016-04-12 13:43:31 +0200
commitd7e0da1db2ac9e747893ef5f565c554eb246e3f4 (patch)
tree7188113afbaed8aec810abb01affda518d6b0c59
parenta14533430498bfaa91ba19b7fd0268bd2ef7d797 (diff)
core: don't drop transient drop-ins when loading the rest
Previously, when creating a transient unit, we'd first add the transient drop-ins to the unit, and then normally load any other drop-ins later on top of this, replacing the already loaded drop-ins. Let's not do this, after all the transient drop-ins area already in effect, let's just add what we find on disk, but not replace it.
-rw-r--r--src/core/load-dropin.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/core/load-dropin.c b/src/core/load-dropin.c
index 1c65055a3f..f83fa09301 100644
--- a/src/core/load-dropin.c
+++ b/src/core/load-dropin.c
@@ -44,6 +44,7 @@ static int add_dependency_consumer(
}
int unit_load_dropin(Unit *u) {
+ _cleanup_strv_free_ char **l = NULL;
Iterator i;
char *t, **f;
int r;
@@ -63,11 +64,19 @@ int unit_load_dropin(Unit *u) {
}
}
- u->dropin_paths = strv_free(u->dropin_paths);
- r = unit_find_dropin_paths(u, &u->dropin_paths);
+ r = unit_find_dropin_paths(u, &l);
if (r <= 0)
return 0;
+ if (!u->dropin_paths) {
+ u->dropin_paths = l;
+ l = NULL;
+ } else {
+ r = strv_extend_strv(&u->dropin_paths, l, true);
+ if (r < 0)
+ return log_oom();
+ }
+
STRV_FOREACH(f, u->dropin_paths) {
config_parse(u->id, *f, NULL,
UNIT_VTABLE(u)->sections,