diff mbox series

[LEDE-DEV,3/3] base-files: protect stop and reload actions with procd_lock

Message ID 20171214215508.4880-1-roman@advem.lv
State Accepted
Delegated to: John Crispin
Headers show
Series protect init scripts from races | expand

Commit Message

Roman Yeryomin Dec. 14, 2017, 9:55 p.m. UTC
Signed-off-by: Roman Yeryomin <roman@advem.lv>
Signed-off-by: Andrejs Hanins <ahanins@gmail.com>
---
 package/base-files/files/etc/rc.common | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common
index a2ea6a5679..89ad187c3c 100755
--- a/package/base-files/files/etc/rc.common
+++ b/package/base-files/files/etc/rc.common
@@ -126,12 +126,14 @@  ${INIT_TRACE:+set -x}
 	}
 
 	stop() {
+		procd_lock
 		stop_service "$@"
 		procd_kill "$(basename ${basescript:-$initscript})" "$1"
 	}
 
 	reload() {
 		if eval "type reload_service" 2>/dev/null >/dev/null; then
+			procd_lock
 			reload_service "$@"
 		else
 			start