[LEDE-DEV] [RFC 1/1] base-files/etc/rc.common: allow services to overwrite PROCD functions

Zefir Kurtisi zefir.kurtisi at neratec.com
Mon Nov 20 02:20:47 PST 2017


PROCD services can't overwrite those functions defined in the
USE_PROCD body (like stop()), since the initfile is sourced
before.

This change moves the sourcing below and with that allows
PROCD init scripts to overwrite them.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi at neratec.com>
---
 package/base-files/files/etc/rc.common | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common
index a2ea6a5679..2d89ebe67f 100755
--- a/package/base-files/files/etc/rc.common
+++ b/package/base-files/files/etc/rc.common
@@ -98,8 +98,6 @@ service_running() {
 
 ${INIT_TRACE:+set -x}
 
-. "$initscript"
-
 [ -n "$USE_PROCD" ] && {
 	EXTRA_COMMANDS="${EXTRA_COMMANDS} running trace"
 
@@ -143,6 +141,8 @@ ${INIT_TRACE:+set -x}
 	}
 }
 
+. "$initscript"
+
 ALL_COMMANDS="start stop reload restart boot shutdown enable disable enabled depends ${EXTRA_COMMANDS}"
 list_contains ALL_COMMANDS "$action" || action=help
 $action "$@"
-- 
2.14.1




More information about the Lede-dev mailing list