diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-06-15 14:32:26 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-06-15 14:32:26 +0200 |
commit | 2ded0c0442f597dc397f7b0e9a15cf453578d11e (patch) | |
tree | a7da24862af9f11642534a3b2b0ee263e6a5ab61 | |
parent | 479ef5d398e4c7467396bdfcdbad3e121150cfd6 (diff) |
manager: recheck unit paths on daemon reload
-rw-r--r-- | src/manager.c | 10 | ||||
-rw-r--r-- | src/systemctl.c | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/manager.c b/src/manager.c index 38964939c3..b4b963a662 100644 --- a/src/manager.c +++ b/src/manager.c @@ -241,6 +241,12 @@ static int manager_find_paths(Manager *m) { assert(m); + /* Unset previous data, in case we are called on reload */ + strv_free(m->unit_path); + strv_free(m->sysvinit_path); + strv_free(m->sysvrcnd_path); + m->unit_path = m->sysvinit_path = m->sysvrcnd_path = NULL; + /* First priority is whatever has been passed to us via env * vars */ if ((e = getenv("SYSTEMD_UNIT_PATH"))) @@ -2346,6 +2352,10 @@ int manager_reload(Manager *m) { /* From here on there is no way back. */ manager_clear_jobs_and_units(m); + /* Find new unit paths */ + if ((q = manager_find_paths(m)) < 0) + r = q; + /* First, enumerate what we can from all config files */ if ((q = manager_enumerate(m)) < 0) r = q; diff --git a/src/systemctl.c b/src/systemctl.c index b0fb7b24ae..be32b0d152 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -1397,7 +1397,6 @@ static int parse_argv(int argc, char *argv[]) { int main(int argc, char*argv[]) { - static const struct { const char* verb; const enum { |