aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wendler <polynomial-c@gentoo.org>2021-05-12 21:01:06 +0200
committerWilliam Hubbs <w.d.hubbs@gmail.com>2021-05-12 18:20:43 -0500
commit0d86c4903bdc68d2d4704ab6c2d4fc8f2c054276 (patch)
treee438742fa2d68fd8c440060c69e94a22534088c8
parent791322d7fa9d5bbceed558258baeff51a39787c5 (diff)
init.d/modules.in: Avoid loading modules twice in Linux with dash shell
Since commit 6b475ab26992f1dd8815700828df46abc4b71d27, openrc tries to load modules twice which have been defined in /etc/conf.d/modules via modules= variable when /bin/sh points to dash shell. The reason is that when the "modules-load" service was merged into "modules" service, the "modules" variable name got used in both, load_modules() function and in Linux_modules() function which both get called when modules service is started. Although "modules" variable is marked as local in load_modules(), dash simply ignores this. Avoid the issue by renaming "modules" variable to "_modules" in load_modules() function. This fixes #419.
-rw-r--r--init.d/modules.in6
1 files changed, 3 insertions, 3 deletions
diff --git a/init.d/modules.in b/init.d/modules.in
index abaab85b..3bcd2dda 100644
--- a/init.d/modules.in
+++ b/init.d/modules.in
@@ -41,18 +41,18 @@ find_modfiles()
load_modules()
{
- local file m modules rc x
+ local file m _modules rc x
file=$1
[ -z "$file" ] && return 0
while read m x; do
case $m in
\;*) continue ;;
\#*) continue ;;
- *) modules="$modules $m"
+ *) _modules="$_modules $m"
;;
esac
done < $file
- for x in $modules; do
+ for x in $_modules; do
ebegin "Loading module $x"
case "$RC_UNAME" in
FreeBSD) kldload "$x"; rc=$? ;;