commit:     d4d559323819c8a5279bf197d8d3ff80f1e28cdc
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Mon Sep  5 16:20:03 2016 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Tue Sep  6 18:34:25 2016 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=d4d55932

sh/openrc-run.sh: read global configuration settings first

X-Gentoo-Bug: 503134
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=503134

 NEWS.md             |  6 ++++++
 sh/openrc-run.sh.in | 18 +++++++++---------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/NEWS.md b/NEWS.md
index d50741a..931d0ab 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -5,6 +5,12 @@ the information in this file is in reverse order.
 
 ## OpenRC-0.22
 
+In previous versions of OpenRC, configuration information was processed
+so that service-specific configuration stored in /etc/conf.d/* was
+overridden by global configuration stored in /etc/rc.conf. This release
+reverses that. Global configuration is now overridden by
+service-specific configuration.
+
 The swapfiles service, which was basically a copy of the swap service,
 has been removed. If you are only using swap partitions, this change
 will not affect you. If you are using swap files, please adjust the

diff --git a/sh/openrc-run.sh.in b/sh/openrc-run.sh.in
index ce5432f..4cbfb16 100644
--- a/sh/openrc-run.sh.in
+++ b/sh/openrc-run.sh.in
@@ -193,6 +193,15 @@ status()
 
 yesno $RC_DEBUG && set -x
 
+# Load configuration settings. First the global ones, then any
+# service-specific settings.
+sourcex -e "@SYSCONFDIR@/rc.conf"
+if [ -d "@SYSCONFDIR@/rc.conf.d" ]; then
+       for _f in "@SYSCONFDIR@"/rc.conf.d/*.conf; do
+               sourcex -e "$_f"
+       done
+fi
+
 _conf_d=${RC_SERVICE%/*}/../conf.d
 # If we're net.eth0 or openvpn.work then load net or openvpn config
 _c=${RC_SVCNAME%%.*}
@@ -209,15 +218,6 @@ if ! sourcex -e "$_conf_d/$RC_SVCNAME.$RC_RUNLEVEL"; then
 fi
 unset _conf_d
 
-# Load any system overrides
-sourcex -e "@SYSCONFDIR@/rc.conf"
-if [ -d "@SYSCONFDIR@/rc.conf.d" ]; then
-       for _f in "@SYSCONFDIR@"/rc.conf.d/*.conf; do
-               sourcex -e "$_f"
-       done
-fi
-
-
 # load service supervisor functions
 sourcex "@LIBEXECDIR@/sh/runit.sh"
 sourcex "@LIBEXECDIR@/sh/s6.sh"

Reply via email to