base-files: protect stop and reload actions with procd_lock
authorRoman Yeryomin <roman@advem.lv>
Thu, 14 Dec 2017 21:55:08 +0000 (23:55 +0200)
committerJohn Crispin <john@phrozen.org>
Tue, 2 Jan 2018 06:52:57 +0000 (07:52 +0100)
Signed-off-by: Roman Yeryomin <roman@advem.lv>
Signed-off-by: Andrejs Hanins <ahanins@gmail.com>
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