mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-05 21:21:49 +00:00
sysv-generator: initialize units before use to ensure correct ordering
The original loop called fix_order() on each service immediately after
loading it, but fix_order() would reference other units which were not
loaded yet.
This resulted in bogus and unnecessary orderings based on the static
start priorities.
Therefore call load_sysv() for every init script when traversing them in
enumerate_sysv(). This ensures that all units are loaded when
fix_order() is called.
Bug-Debian: https://bugs.debian.org/771118
(cherry picked from commit 1ed0c19f81)
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
5bf11a0f2e
commit
24f984a147
@@ -760,6 +760,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();
|
||||
@@ -944,10 +948,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;
|
||||
|
||||
Reference in New Issue
Block a user