summaryrefslogtreecommitdiff
path: root/system/openrc/0005-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-20 21:20:18 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-20 21:20:18 -0600
commit866f81aaa5e438537e6a4b30c1f0fcecc713a1a2 (patch)
tree4bce7ccd2a7603bdf638e250b8e30e54c1dea909 /system/openrc/0005-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch
parent31f3497a1ca9637ff42f3185a5924e0f4e61ab5d (diff)
downloadpackages-866f81aaa5e438537e6a4b30c1f0fcecc713a1a2.tar.gz
packages-866f81aaa5e438537e6a4b30c1f0fcecc713a1a2.tar.bz2
packages-866f81aaa5e438537e6a4b30c1f0fcecc713a1a2.tar.xz
packages-866f81aaa5e438537e6a4b30c1f0fcecc713a1a2.zip
system/openrc: migrate from aports fork
Diffstat (limited to 'system/openrc/0005-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch')
-rw-r--r--system/openrc/0005-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch71
1 files changed, 71 insertions, 0 deletions
diff --git a/system/openrc/0005-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch b/system/openrc/0005-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch
new file mode 100644
index 000000000..eb1ad1408
--- /dev/null
+++ b/system/openrc/0005-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch
@@ -0,0 +1,71 @@
+From b62d7b9438af6dac50d52708777070f312e6650c Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Wed, 1 Feb 2017 04:17:14 +0000
+Subject: [PATCH 5/7] 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 110591e4..13a7e0d4 100644
+--- a/src/rc/rc.c
++++ b/src/rc/rc.c
+@@ -738,6 +738,7 @@ int main(int argc, char **argv)
+ const char *bootlevel = NULL;
+ char *newlevel = NULL;
+ const char *systype = NULL;
++ RC_STRINGLIST *runlevel_chain;
+ RC_STRINGLIST *deporder = NULL;
+ RC_STRINGLIST *tmplist;
+ RC_STRING *service;
+@@ -993,6 +994,7 @@ int main(int argc, char **argv)
+ main_hotplugged_services = rc_services_in_state(RC_SERVICE_HOTPLUGGED);
+ main_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)
+ {
+@@ -1010,6 +1012,7 @@ int main(int argc, char **argv)
+ tmplist = rc_services_in_runlevel(bootlevel);
+ TAILQ_CONCAT(main_start_services, tmplist, entries);
+ free(tmplist);
++ rc_stringlist_add(runlevel_chain, bootlevel);
+ }
+ if (main_hotplugged_services) {
+ TAILQ_FOREACH(service, main_hotplugged_services,
+@@ -1018,6 +1021,7 @@ int main(int argc, char **argv)
+ service->value);
+ }
+ }
++ rc_stringlist_add(runlevel_chain, RC_LEVEL_SYSINIT);
+ }
+
+ parallel = rc_conf_yesno("rc_parallel");
+@@ -1074,9 +1078,6 @@ int main(int argc, char **argv)
+
+ /* If we have a list of services to start then... */
+ if (main_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)
+--
+2.11.0
+