procd: fix procd_lock() when prepare_roofs
authorYousong Zhou <yszhou4tech@gmail.com>
Sun, 28 Jan 2018 01:43:30 +0000 (09:43 +0800)
committerYousong Zhou <yszhou4tech@gmail.com>
Sun, 28 Jan 2018 01:51:06 +0000 (09:51 +0800)
This fixes the following errors when doing "make package/install"

    /home/yousong/git-repo/lede-project/lede/build_dir/target-mips_24kc_musl/root-malta/lib/functions/procd.sh: line 47: /home/yousong/git-repo/l
    ede-project/lede/build_dir/target-mips_24kc_musl/root-malta/var/lock/procd_urandom_seed.lock: No such file or directory
    flock: 1000: Bad file descriptor

Fixes FS#1260

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
include/rootfs.mk
package/system/procd/Makefile
package/system/procd/files/procd.sh

index 74785cbbd39cfbd50d087ec157323f64fb52995b..1844f849e2436fb8b1bc5ffa98983aea33565ff9 100644 (file)
@@ -60,6 +60,7 @@ define prepare_rootfs
                $(call file_copy,$(TOPDIR)/files/.,$(1)); \
        fi
        @mkdir -p $(1)/etc/rc.d
+       @mkdir -p $(1)/var/lock
        @( \
                cd $(1); \
                for script in ./usr/lib/opkg/info/*.postinst; do \
@@ -84,6 +85,7 @@ define prepare_rootfs
        rm -f $(1)/usr/lib/opkg/lists/*
        rm -f $(1)/usr/lib/opkg/info/*.postinst*
        rm -f $(1)/usr/lib/opkg/info/*.prerm*
+       rm -f $(1)/var/lock/*.lock
        $(call clean_ipkg,$(1))
        $(call mklibs,$(1))
 endef
index 7b673e424695a3b7f4fb7f445698d713dbc9e237..b3b38ada8b67d2f9aead2d915d69fa85b35170da 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=procd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git
index b4b6faa6627af447108bb6542d7c63af65e818a2..6f16b746ffb42c3c7eeba9fed628676a8eb3e761 100644 (file)
@@ -33,7 +33,7 @@
 #   Send a signal to a service instance (or all instances)
 #
 
-. $IPKG_INSTROOT/usr/share/libubox/jshn.sh
+. "$IPKG_INSTROOT/usr/share/libubox/jshn.sh"
 
 PROCD_RELOAD_DELAY=1000
 _PROCD_SERVICE=
@@ -44,7 +44,7 @@ procd_lock() {
 
        flock -n 1000 &> /dev/null
        if [ "$?" != "0" ]; then
-               exec 1000>/var/lock/procd_${service_name}.lock
+               exec 1000>"$IPKG_INSTROOT/var/lock/procd_${service_name}.lock"
                flock 1000
                if [ "$?" != "0" ]; then
                        logger "warning: procd flock for $service_name failed"