If a service fails to load, we skip fix_order() and the generator uses the static start priorities. This induces bogus orderings against unrelated services. So instead, just don't add a service to the all_services hash_map, if it fails to load.
Bug-Debian: https://bugs.debian.org/771118 See attached patch -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?
From 679f5f1c5fe04db9c4a2d0be54b4faf753983582 Mon Sep 17 00:00:00 2001 From: Michael Biebl <[email protected]> Date: Fri, 28 Nov 2014 06:04:48 +0100 Subject: [PATCH] sysv-generator: avoid wrong orderings for failing units If a service fails to load, we skip fix_order() and the generator uses the static start priorities. This induces bogus orderings against unrelated services. So instead, just don't add a service to the all_services hash_map, if it fails to load. Bug-Debian: https://bugs.debian.org/771118 --- src/sysv-generator/sysv-generator.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c index f78ddeb..2f24ef2 100644 --- a/src/sysv-generator/sysv-generator.c +++ b/src/sysv-generator/sysv-generator.c @@ -755,6 +755,10 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) { service->name = name; service->path = fpath; + r = load_sysv(service); + if (r < 0) + continue; + r = hashmap_put(all_services, service->name, service); if (r < 0) return log_oom(); @@ -939,10 +943,6 @@ int main(int argc, char *argv[]) { } HASHMAP_FOREACH(service, all_services, j) { - q = load_sysv(service); - if (q < 0) - continue; - q = fix_order(service, all_services); if (q < 0) continue; -- 2.1.4
_______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
