From patchwork Thu Jan 18 08:14:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 862789 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hx45kzYf"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zMcFB6lfbz9ryT for ; Thu, 18 Jan 2018 19:14:38 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id: Date:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=FtynYZtvzSKDBl+eNdpa95YsfT1r+eqa3dDMKMghTAE=; b=hx45kzYfCYS8Gy gsL7CFPK1uf6X2yOvm0fBWB63h732z9ZAQg1kMuLhAkoya//oIcg7Kfhx5gV0x5RMFWQq296Hdtwu WYafDghxah4JgcVlIpQaAglDEoWyDCTrKXNlixrgt0trWXIrfSRdjsxwP3gRugaS3xEidlm7vEmF+ rHiFGdUDKD+a39GFA6xvWL8OrEM97ZB7P9Y+NTPF7amGHiniDw5BAwVzrd03pUAVpptteTTy/qHtW KkQNgdl+CIq1nm+ohJsVQM8eWtnfK6WueK4Hp6Kq3E39FRqSRwiMmpbKG6nZbeNl2Zyqt88jf3OTm HQ4M4rV8y2AzqFltrksw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ec5LG-0008Jc-84; Thu, 18 Jan 2018 08:14:34 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ec5LD-0008Ir-4t for lede-dev@lists.infradead.org; Thu, 18 Jan 2018 08:14:33 +0000 From: John Crispin To: lede-dev@lists.infradead.org Date: Thu, 18 Jan 2018 09:14:06 +0100 Message-Id: <20180118081407.5214-1-john@phrozen.org> X-Mailer: git-send-email 2.11.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: [LEDE-DEV] [PATCH 1/2] procd/base-files: move init.d locking to rc.common X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: roman@advem.lv, John Crispin MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org rather than using flock for procd enabled services we add locking to the rc.common code. Signed-off-by: John Crispin --- package/base-files/files/etc/rc.common | 6 ++++++ package/system/procd/files/procd.sh | 15 --------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index 3e237170b4..180ee83acd 100755 --- a/package/base-files/files/etc/rc.common +++ b/package/base-files/files/etc/rc.common @@ -148,4 +148,10 @@ ${INIT_TRACE:+set -x} ALL_COMMANDS="start stop reload restart boot shutdown enable disable enabled depends ${EXTRA_COMMANDS}" list_contains ALL_COMMANDS "$action" || action=help + +local basescript=$(readlink "$initscript") +local service_name="$(basename ${basescript:-$initscript})" + +lock -w /var/lock/init.d_${service_name}.lock $action "$@" +lock -u /var/lock/init.d_${service_name}.lock diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh index b4b6faa662..b7d7b94ff1 100644 --- a/package/system/procd/files/procd.sh +++ b/package/system/procd/files/procd.sh @@ -38,20 +38,6 @@ PROCD_RELOAD_DELAY=1000 _PROCD_SERVICE= -procd_lock() { - local basescript=$(readlink "$initscript") - local service_name="$(basename ${basescript:-$initscript})" - - flock -n 1000 &> /dev/null - if [ "$?" != "0" ]; then - exec 1000>/var/lock/procd_${service_name}.lock - flock 1000 - if [ "$?" != "0" ]; then - logger "warning: procd flock for $service_name failed" - fi - fi -} - _procd_call() { local old_cb @@ -61,7 +47,6 @@ _procd_call() { } _procd_wrapper() { - procd_lock while [ -n "$1" ]; do eval "$1() { _procd_call _$1 \"\$@\"; }" shift From patchwork Thu Jan 18 08:14:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 862790 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lDDQwBRS"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zMcFJ1dwMz9ryT for ; Thu, 18 Jan 2018 19:14:44 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YwYfwwXO8yEWtDa+Ogw4u+VdDriLM8hlWEEI6ThyAok=; b=lDDQwBRSjZa6J4 TK2lo5fkFWdY4cRCtVsPwwV+uRmqs7IN8oOmVd7DvpeLALP/VV7P9Wb7lbtvlf33FHwL21vYbydWq sQI5b03lCqOwQNrOClqBWWlz4c+AvYSwdWUda3LeQOCtVAfpTq79nQHWBZ7eFjogY3oxRqP90XZ65 8pxaLolQInYTbOcvG0YviP9efScMIk/w07dlzsXzZSAfN1u2GG+gE5GHHs0/xW/UYQP5RYMbS1v56 fxPppzsVWhjalYAELsg0l0UjUFPCNikVK3DeI3vyFjolcLZTUxgG1bDZ1vp48mX5NcjN/DuL44dGz Tn1OfI3+n1BalL9N2EdQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ec5LN-0008R8-Rh; Thu, 18 Jan 2018 08:14:41 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ec5LD-0008Ik-4s for lede-dev@lists.infradead.org; Thu, 18 Jan 2018 08:14:34 +0000 From: John Crispin To: lede-dev@lists.infradead.org Date: Thu, 18 Jan 2018 09:14:07 +0100 Message-Id: <20180118081407.5214-2-john@phrozen.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180118081407.5214-1-john@phrozen.org> References: <20180118081407.5214-1-john@phrozen.org> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: [LEDE-DEV] [PATCH 2/2] Revert "busybox: enable flock by default" X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: roman@advem.lv, John Crispin MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This reverts commit 2277cd1249a6952228f36b768beea117c91123a0. Signed-off-by: John Crispin --- package/utils/busybox/Config-defaults.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index 4e429f4371..afb7d48f8c 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -1497,7 +1497,7 @@ config BUSYBOX_DEFAULT_FINDFS default n config BUSYBOX_DEFAULT_FLOCK bool - default y + default n config BUSYBOX_DEFAULT_FDFLUSH bool default n