diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-05-15 11:44:30 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-05-15 11:46:18 +0000 |
commit | c4bc9ea6dca37b8adc522df24649f7081e26777a (patch) | |
tree | b1688f154179439067c489137ad6189666ebe9ed /main/openrc/rc-pull-in-sysinit-and-boot-as-stacked-levels-when-needed.patch | |
parent | 8df570d9915181c49b21f33244fa21bf970b4002 (diff) | |
download | aports-c4bc9ea6dca37b8adc522df24649f7081e26777a.tar.bz2 aports-c4bc9ea6dca37b8adc522df24649f7081e26777a.tar.xz |
main/openrc: fix starting service in boot runlevel
upstream issue: https://github.com/OpenRC/openrc/issues/54
Diffstat (limited to 'main/openrc/rc-pull-in-sysinit-and-boot-as-stacked-levels-when-needed.patch')
-rw-r--r-- | main/openrc/rc-pull-in-sysinit-and-boot-as-stacked-levels-when-needed.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/main/openrc/rc-pull-in-sysinit-and-boot-as-stacked-levels-when-needed.patch b/main/openrc/rc-pull-in-sysinit-and-boot-as-stacked-levels-when-needed.patch new file mode 100644 index 0000000000..b8776553a1 --- /dev/null +++ b/main/openrc/rc-pull-in-sysinit-and-boot-as-stacked-levels-when-needed.patch @@ -0,0 +1,67 @@ +From fbbad65b293c2254edcdfab0171bbe204464d503 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Thu, 14 May 2015 18:52:07 +0000 +Subject: [PATCH] rc: pull in sysinit and boot as stacked levels when needed + +We need start services from sysinit and boot runlevel, even if the new +runlevel is empty. + +This fixes problem introduced with commit 7716bf31 (Fix stacked runlevel +support), at which the start_services list are no longer used to start +the services. + +This also make sure that all services in sysinit and boot runlevels are +started before switching to next. This was not guaranteed when switching +to a non-empty runlevel. + +Fixes issue #54. +--- + src/rc/rc.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/rc/rc.c b/src/rc/rc.c +index dd35482..4edb539 100644 +--- a/src/rc/rc.c ++++ b/src/rc/rc.c +@@ -757,6 +757,7 @@ main(int argc, char **argv) + static RC_STRINGLIST *types_n; + static RC_STRINGLIST *types_nua; + static RC_DEPTREE *deptree; ++ RC_STRINGLIST *runlevel_chain; + RC_STRINGLIST *deporder = NULL; + RC_STRINGLIST *tmplist; + RC_STRING *service; +@@ -1016,6 +1017,7 @@ main(int argc, char **argv) + hotplugged_services = rc_services_in_state(RC_SERVICE_HOTPLUGGED); + start_services = rc_services_in_runlevel_stacked(newlevel ? + newlevel : runlevel); ++ runlevel_chain = rc_runlevel_stacks(newlevel ? newlevel : runlevel); + if (strcmp(newlevel ? newlevel : runlevel, RC_LEVEL_SHUTDOWN) != 0 && + strcmp(newlevel ? newlevel : runlevel, RC_LEVEL_SYSINIT) != 0) + { +@@ -1033,6 +1035,7 @@ main(int argc, char **argv) + tmplist = rc_services_in_runlevel(bootlevel); + TAILQ_CONCAT(start_services, tmplist, entries); + free(tmplist); ++ rc_stringlist_add(runlevel_chain, bootlevel); + } + if (hotplugged_services) { + TAILQ_FOREACH(service, hotplugged_services, +@@ -1041,6 +1044,7 @@ main(int argc, char **argv) + service->value); + } + } ++ rc_stringlist_add(runlevel_chain, RC_LEVEL_SYSINIT); + } + + parallel = rc_conf_yesno("rc_parallel"); +@@ -1097,9 +1101,6 @@ main(int argc, char **argv) + + /* If we have a list of services to start then... */ + if (start_services) { +- /* Get a list of the chained runlevels which compose the target runlevel */ +- RC_STRINGLIST *runlevel_chain = rc_runlevel_stacks(runlevel); +- + /* Loop through them in reverse order. */ + RC_STRING *rlevel; + TAILQ_FOREACH_REVERSE(rlevel, runlevel_chain, rc_stringlist, entries) |