[luci] backport: prevent concurrent luci reload instances
This commit is contained in:
parent
3c5dacaf56
commit
ea69aa3ee5
|
@ -6,6 +6,8 @@ apply_config() {
|
||||||
config_get exec "$1" exec
|
config_get exec "$1" exec
|
||||||
config_get test "$1" test
|
config_get test "$1" test
|
||||||
|
|
||||||
|
echo "$2" > "/var/run/luci-reload-status"
|
||||||
|
|
||||||
[ -n "$init" ] && reload_init "$2" "$init" "$test"
|
[ -n "$init" ] && reload_init "$2" "$init" "$test"
|
||||||
[ -n "$exec" ] && reload_exec "$2" "$exec" "$test"
|
[ -n "$exec" ] && reload_exec "$2" "$exec" "$test"
|
||||||
}
|
}
|
||||||
|
@ -26,9 +28,13 @@ reload_init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lock "/var/run/luci-reload"
|
||||||
|
|
||||||
config_load ucitrack
|
config_load ucitrack
|
||||||
|
|
||||||
for i in $*
|
for i in $*; do
|
||||||
do
|
|
||||||
config_foreach apply_config $i $i
|
config_foreach apply_config $i $i
|
||||||
done
|
done
|
||||||
|
|
||||||
|
rm -f "/var/run/luci-reload-status"
|
||||||
|
lock -u "/var/run/luci-reload"
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
--- a/libs/uci/root/sbin/luci-reload (revision 3404)
|
||||||
|
+++ b/libs/uci/root/sbin/luci-reload (revision 6271)
|
||||||
|
@@ -6,5 +6,7 @@
|
||||||
|
config_get exec "$1" exec
|
||||||
|
config_get test "$1" test
|
||||||
|
-
|
||||||
|
+
|
||||||
|
+ echo "$2" > "/var/run/luci-reload-status"
|
||||||
|
+
|
||||||
|
[ -n "$init" ] && reload_init "$2" "$init" "$test"
|
||||||
|
[ -n "$exec" ] && reload_exec "$2" "$exec" "$test"
|
||||||
|
@@ -27,8 +29,12 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
+lock "/var/run/luci-reload"
|
||||||
|
+
|
||||||
|
config_load ucitrack
|
||||||
|
|
||||||
|
-for i in $*
|
||||||
|
-do
|
||||||
|
+for i in $*; do
|
||||||
|
config_foreach apply_config $i $i
|
||||||
|
done
|
||||||
|
+
|
||||||
|
+rm -f "/var/run/luci-reload-status"
|
||||||
|
+lock -u "/var/run/luci-reload"
|
Loading…
Reference in New Issue