From patchwork Mon Sep 25 12:28:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karl Palsson X-Patchwork-Id: 818222 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="Ty0j740j"; 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 3y13LZ64Lxz9sPk for ; Mon, 25 Sep 2017 22:29:42 +1000 (AEST) 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=FA/Q1WsOvQkVXcovdxyjblx7oo/PwZFeQYiNkFyL8aM=; b=Ty0j740j7uoUAK 4L/orf3lmHwydTferEjin/EdpNpnt/GfPkrfSx62LxPZLF5TMm7k2AZ4sV9/DAS6X1i9YrlXlNh8v m9NbaT00LNWxJKsvQCRaH+K4PBapff1BuropiHcW4JCT1ZkEn/gtmNi9aCHy98a1qP82q+G6RHNNO N+bfgpeoVwcmkXTntAAtFsKLjh4WaaYSH9lvKQTZYD3+OG+TJjIv9jiPHYizKsNrR6wb2zgMWni0f 71VJeQhMGLeAFoMYoq/jYc63yOgWbgq2rMaTnNFJsGpa4WMyNSvbkJhKRX4djvnYcHECUxt7V0QAG HF0s738UePtKCJZRDDVg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dwSVn-0002vF-3m; Mon, 25 Sep 2017 12:29:23 +0000 Received: from palmtree.beeroclock.net ([178.79.160.154]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dwSVi-0002lj-Ac for lede-dev@lists.infradead.org; Mon, 25 Sep 2017 12:29:21 +0000 Received: from cuth.localdomain.localdomain (rtr1.dogg-hlidasmara14.sip.is [178.19.53.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: karlp) by palmtree.beeroclock.net (Postfix) with ESMTPSA id 6C079101D7; Mon, 25 Sep 2017 12:28:32 +0000 (UTC) From: Karl Palsson To: lede-dev@lists.infradead.org Date: Mon, 25 Sep 2017 12:28:16 +0000 Message-Id: <1506342496-30508-1-git-send-email-karlp@etactica.com> X-Mailer: git-send-email 2.4.11 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170925_052918_626375_A356C933 X-CRM114-Status: UNSURE ( 6.00 ) X-CRM114-Notice: Please train this message. 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_FAIL SPF: sender does not match SPF record (fail) [SPF failed: Please see http://www.openspf.org/Why?s=mfrom; id=karlp%40etactica.com; ip=178.79.160.154; r=bombadil.infradead.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: [LEDE-DEV] [PATCH] instance: properly compare and reload respawn config 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: Karl Palsson MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org respawn configuration variables were not checked for changes, and were not copied to new instances. Signed-off-by: Karl Palsson --- service/instance.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/service/instance.c b/service/instance.c index a968a0b..d12c580 100644 --- a/service/instance.c +++ b/service/instance.c @@ -629,6 +629,13 @@ instance_config_changed(struct service_instance *in, struct service_instance *in if (!in->pidfile && in_new->pidfile) return true; + if (in->respawn_retry != in_new->respawn_retry) + return true; + if (in->respawn_threshold != in_new->respawn_threshold) + return true; + if (in->respawn_timeout != in_new->respawn_timeout) + return true; + if (!blobmsg_list_equal(&in->limits, &in_new->limits)) return true; @@ -949,6 +956,9 @@ instance_config_move(struct service_instance *in, struct service_instance *in_sr in->trigger = in_src->trigger; in->command = in_src->command; in->pidfile = in_src->pidfile; + in->respawn_retry = in_src->respawn_retry; + in->respawn_threshold = in_src->respawn_threshold; + in->respawn_timeout = in_src->respawn_timeout; in->name = in_src->name; in->node.avl.key = in_src->node.avl.key;