base-files: protect stop and reload actions with procd_lock
[openwrt/openwrt.git] / package / base-files / files / etc / rc.common
index a08c1f8..3e23717 100755 (executable)
@@ -127,12 +127,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