From patchwork Wed Dec 2 14:52:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Eckert X-Patchwork-Id: 1409778 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=dev.tdt.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=qkxCEXlL; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CmMT8013Kz9sPB for ; Thu, 3 Dec 2020 01:55:07 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=q+MkRwUfJrdSnckskYUnoKnkU0DOWvLYuvj2X/MjAAY=; b=qkxCEXlLqGV2n0TEBvlxBf1Cu EHvoA2XDthkA0uTGhw+qJ9bDA5KVxg3v96bIx3JWgZ3DkVEDwKTsIyMwVFhoWBLgtxcmZeCxFhjK0 cmdA1DQyGaCx0UJyNHHUtljMyAFH0zur5QSCu3KEnkpQlG1oKdctdgJnqFOlkgREOTvmIYXoqOo3f uE9gSBBKkZP1EaWHIEcKyhICOFBcnJgQaN5EznIN9p5xJ+mV2Yv6hr4LQFnfbd99OxLueedQYOQut ELFyqHZnqaw3rJa5dzcWrwcJnHLt+n9+MZaYtzrrv/ToiWqQ05k0WcEM1v6PmIIzUKo/cd3QheLBq z9nsFJTwQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkTVX-0003Tv-Or; Wed, 02 Dec 2020 14:53:27 +0000 Received: from mxout70.expurgate.net ([194.37.255.70]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkTVT-0003Rz-Ta for openwrt-devel@lists.openwrt.org; Wed, 02 Dec 2020 14:53:24 +0000 Received: from [127.0.0.1] (helo=localhost) by relay.expurgate.net with smtp (Exim 4.90) (envelope-from ) id 1kkTVQ-0006oY-JO; Wed, 02 Dec 2020 15:53:20 +0100 Received: from [195.243.126.94] (helo=securemail.tdt.de) by relay.expurgate.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90) (envelope-from ) id 1kkTVP-0007yX-Ul; Wed, 02 Dec 2020 15:53:19 +0100 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 8BAAF240041; Wed, 2 Dec 2020 15:53:19 +0100 (CET) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 20FBF240040; Wed, 2 Dec 2020 15:53:19 +0100 (CET) Received: from feckert.dev.tdt.de (unknown [10.2.3.40]) by mail.dev.tdt.de (Postfix) with ESMTPSA id 2E2F820046; Wed, 2 Dec 2020 15:53:18 +0100 (CET) From: Florian Eckert To: daniel@makrotopia.org, john@phrozen.org Subject: [PATCH 1/5] procd: add restart ubus call Date: Wed, 2 Dec 2020 15:52:29 +0100 Message-ID: <20201202145233.10463-2-fe@dev.tdt.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201202145233.10463-1-fe@dev.tdt.de> References: <20201202145233.10463-1-fe@dev.tdt.de> MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.dev.tdt.de X-purgate-type: clean X-purgate: clean X-purgate-ID: 151534::1606920800-000013A4-98DA8D76/0/0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201202_095324_143163_578EEC56 X-CRM114-Status: GOOD ( 14.68 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [194.37.255.70 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openwrt-devel@lists.openwrt.org, aaronjg@alumni.stanford.edu, Florian Eckert , Florian.Eckert@googlemail.com Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org To allow other services to respsond to a restart event from a procd initialised service, a new ubus method "restart" in the ubus "service" path is needed to trigger a ubus notify and also execute the installed service triggers. Cc: Aaron Goodman Signed-off-by: Florian Eckert The original implementation is by Aaron Goodman. --- .../patches/0010-add-restart-event.patch | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 package/system/procd/patches/0010-add-restart-event.patch diff --git a/package/system/procd/patches/0010-add-restart-event.patch b/package/system/procd/patches/0010-add-restart-event.patch new file mode 100644 index 0000000000..86ec3d38e1 --- /dev/null +++ b/package/system/procd/patches/0010-add-restart-event.patch @@ -0,0 +1,64 @@ +--- a/service/service.c ++++ b/service/service.c +@@ -204,6 +204,17 @@ static const struct blobmsg_policy servi + }; + + enum { ++ SERVICE_RESTART_ATTR_NAME, ++ SERVICE_RESTART_ATTR_INSTANCE, ++ __SERVICE_RESTART_ATTR_MAX, ++}; ++ ++static const struct blobmsg_policy service_restart_attrs[__SERVICE_RESTART_ATTR_MAX] = { ++ [SERVICE_RESTART_ATTR_NAME] = { "name", BLOBMSG_TYPE_STRING }, ++ [SERVICE_RESTART_ATTR_INSTANCE] = { "instance", BLOBMSG_TYPE_STRING }, ++}; ++ ++enum { + SERVICE_DEL_ATTR_NAME, + SERVICE_DEL_ATTR_INSTANCE, + __SERVICE_DEL_ATTR_MAX, +@@ -681,6 +692,35 @@ service_handle_update(struct ubus_contex + return 0; + } + ++static int ++service_handle_restart(struct ubus_context *ctx, struct ubus_object *obj, ++ struct ubus_request_data *req, const char *method, ++ struct blob_attr *msg) ++{ ++ struct blob_attr *tb[__SERVICE_RESTART_ATTR_MAX], *cur; ++ struct service *s = NULL; ++ const char *name; ++ ++ blobmsg_parse(service_set_attrs, __SERVICE_RESTART_ATTR_MAX, tb, blobmsg_data(msg), blobmsg_data_len(msg)); ++ cur = tb[SERVICE_RESTART_ATTR_NAME]; ++ if (!cur) ++ return UBUS_STATUS_INVALID_ARGUMENT; ++ ++ name = blobmsg_data(cur); ++ ++ s = avl_find_element(&services, name, s, avl); ++ if (!s) ++ return UBUS_STATUS_INVALID_ARGUMENT; ++ ++ blob_buf_init(&b, 0); ++ blobmsg_add_string(&b, "service", s->name); ++ trigger_event("service.restart", b.head); ++ ++ service_event("service.restart", s->name, NULL); ++ ++ return UBUS_STATUS_OK; ++} ++ + static void ubus_event_bcast(const char *type, const char *param1, const char *val1, + const char *param2, const char *val2) + { +@@ -951,6 +991,7 @@ static struct ubus_method main_object_me + UBUS_METHOD("add", service_handle_set, service_set_attrs), + UBUS_METHOD("list", service_handle_list, service_list_attrs), + UBUS_METHOD("delete", service_handle_delete, service_del_attrs), ++ UBUS_METHOD("restart", service_handle_restart, service_restart_attrs), + UBUS_METHOD("signal", service_handle_signal, service_signal_attrs), + UBUS_METHOD("update_start", service_handle_update, service_attrs), + UBUS_METHOD("update_complete", service_handle_update, service_attrs), From patchwork Wed Dec 2 14:52:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Eckert X-Patchwork-Id: 1409775 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=dev.tdt.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=FtxQ7rl3; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CmMSy6v9mz9sPB for ; Thu, 3 Dec 2020 01:54:58 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qnGXp4cTboRnl384nyaM5e3/JPYRkUNY/CEw0+y24AA=; b=FtxQ7rl3Evu9kGe/MPczJ50It EYiRX9lysunHzJmC2Jt0EUP1HpNE3HQwH/Rd6f4KqxW3f67T9dK2QKRJQiT9oY+lBypSZgs2q5SbS 297RvKTDIKdcRGp7W3kRcchj0GPDA1HzrgRalAjlnSOlO0s1fq65bZNhY8y+N8bq9fbhAjhFrSGMe 4zvJ540br5AzJid7PloZ+RaIRm0emM2KBgEPLUgsvmh0PESNjZUA+P1koEdnD54rfj6Fw1Fe1vaoq 4GhOezSHHSo8cX9R4St33fiTgHnkh4UyCdjpGNvauAX+r2yGI69cxVzRGE75I9gWOOX0gpx9wkixi BzcU07+Ow==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkTVd-0003WI-Uj; Wed, 02 Dec 2020 14:53:33 +0000 Received: from mxout70.expurgate.net ([91.198.224.70]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkTVX-0003To-Sk for openwrt-devel@lists.openwrt.org; Wed, 02 Dec 2020 14:53:29 +0000 Received: from [127.0.0.1] (helo=localhost) by relay.expurgate.net with smtp (Exim 4.92) (envelope-from ) id 1kkTVV-000KmN-1i; Wed, 02 Dec 2020 15:53:25 +0100 Received: from [195.243.126.94] (helo=securemail.tdt.de) by relay.expurgate.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kkTVU-000JEw-5p; Wed, 02 Dec 2020 15:53:24 +0100 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id DD98B240041; Wed, 2 Dec 2020 15:53:23 +0100 (CET) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 75513240040; Wed, 2 Dec 2020 15:53:23 +0100 (CET) Received: from feckert.dev.tdt.de (unknown [10.2.3.40]) by mail.dev.tdt.de (Postfix) with ESMTPSA id 4B18D20046; Wed, 2 Dec 2020 15:53:23 +0100 (CET) From: Florian Eckert To: daniel@makrotopia.org, john@phrozen.org Subject: [PATCH 2/5] base-files: add restart function wrapper Date: Wed, 2 Dec 2020 15:52:30 +0100 Message-ID: <20201202145233.10463-3-fe@dev.tdt.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201202145233.10463-1-fe@dev.tdt.de> References: <20201202145233.10463-1-fe@dev.tdt.de> MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.dev.tdt.de X-purgate-ID: 151534::1606920804-00016B9D-1556BEF7/0/0 X-purgate-type: clean X-purgate: clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201202_095328_109070_960C2C05 X-CRM114-Status: GOOD ( 10.79 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [91.198.224.70 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openwrt-devel@lists.openwrt.org, aaronjg@alumni.stanford.edu, Florian Eckert , Florian.Eckert@googlemail.com Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Thies commit add the new wrapper function to rc.common to execute the new ubus service method "restart" on a service restart. Signed-off-by: Florian Eckert --- package/base-files/files/etc/rc.common | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index f39b69464e..ad5af4b7a1 100755 --- a/package/base-files/files/etc/rc.common +++ b/package/base-files/files/etc/rc.common @@ -139,6 +139,19 @@ extra_command "enabled" "Check if service is started on boot" fi } + restart() { + if eval "type restart_service" 2>/dev/null >/dev/null; then + restart_service "$@" + else + trap '' TERM + stop "$@" + trap - TERM + start "$@" + fi + procd_open_service "$(basename ${basescript:-$initscript})" "$initscript" + procd_close_service "restart" + } + trace() { TRACE_SYSCALLS=1 start "$@" From patchwork Wed Dec 2 14:52:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Eckert X-Patchwork-Id: 1409776 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=dev.tdt.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=WAwxYAac; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CmMT40r9sz9sPB for ; Thu, 3 Dec 2020 01:55:04 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AKYEtyWQwJeA4Ydj/CM5UAUI4c5feQ9tKXjaygCGO/A=; b=WAwxYAacZtwpsF/y9HbkcVUaM XYd/I1ECLyyoiPEokG4zF3177+lcmQONQ6/phO7EzpSzHIK0G9LVkwqjG6SZzc4pl/FdvR2kxjHRB 49tlwaQkEoWFtHMtBzVq7R+pyU6oRLYJs1q2kx4wvh0oPbyoeB09WCiWGNgZEWZWFhdb7gBx8X3ks jNiuQpOQcwVdVahS9O1Ux6Yh4wwTOVoViesmxjv2xV+AUTHII5UtDzAUFAGdS2l8kbS1vql7Mw0jJ CvJBKUC0qeKxwr0aPH9O6IsBBZtcbWl/9san7nL98vretVY2xs4077Jo1/8ph5rPoHIxxFQyKeG4j igTVSY+Ww==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkTVc-0003Va-0T; Wed, 02 Dec 2020 14:53:32 +0000 Received: from mxout70.expurgate.net ([91.198.224.70]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkTVX-0003Ts-Sk for openwrt-devel@lists.openwrt.org; Wed, 02 Dec 2020 14:53:29 +0000 Received: from [127.0.0.1] (helo=localhost) by relay.expurgate.net with smtp (Exim 4.92) (envelope-from ) id 1kkTVW-000Slk-IF; Wed, 02 Dec 2020 15:53:26 +0100 Received: from [195.243.126.94] (helo=securemail.tdt.de) by relay.expurgate.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kkTVW-000NNG-0V; Wed, 02 Dec 2020 15:53:26 +0100 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id C138F240041; Wed, 2 Dec 2020 15:53:25 +0100 (CET) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 5A90F240040; Wed, 2 Dec 2020 15:53:25 +0100 (CET) Received: from feckert.dev.tdt.de (unknown [10.2.3.40]) by mail.dev.tdt.de (Postfix) with ESMTPSA id 3553220046; Wed, 2 Dec 2020 15:53:25 +0100 (CET) From: Florian Eckert To: daniel@makrotopia.org, john@phrozen.org Subject: [PATCH 3/5] firewall: fix whitespace Date: Wed, 2 Dec 2020 15:52:31 +0100 Message-ID: <20201202145233.10463-4-fe@dev.tdt.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201202145233.10463-1-fe@dev.tdt.de> References: <20201202145233.10463-1-fe@dev.tdt.de> MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.dev.tdt.de X-purgate-ID: 151534::1606920806-0001C3AC-D7A74B6A/0/0 X-purgate: clean X-purgate-type: clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201202_095328_075341_1B345114 X-CRM114-Status: GOOD ( 11.55 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [91.198.224.70 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openwrt-devel@lists.openwrt.org, aaronjg@alumni.stanford.edu, Florian Eckert , Florian.Eckert@googlemail.com Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Remove trailing whitespace. Signed-off-by: Florian Eckert --- package/network/config/firewall/files/firewall.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/config/firewall/files/firewall.init b/package/network/config/firewall/files/firewall.init index ee3ed1a283..4c2fb7b617 100755 --- a/package/network/config/firewall/files/firewall.init +++ b/package/network/config/firewall/files/firewall.init @@ -29,7 +29,7 @@ validate_firewall_rule() } service_triggers() { - procd_add_reload_trigger firewall + procd_add_reload_trigger firewall procd_open_validate validate_firewall_redirect From patchwork Wed Dec 2 14:52:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Eckert X-Patchwork-Id: 1409779 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=dev.tdt.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=jmQovqJf; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CmMT94VX8z9sSf for ; Thu, 3 Dec 2020 01:55:09 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wrqyOMJEEDIFyscgQoI4DMTHvXOxWiT7PGYCaqyjvnY=; b=jmQovqJfM5sSpheOOyezVHzas BomHX33+vywPUGLFpNdtrKN2f8e3HXCc7SR29SnjlSzqnmXztKCL5Oi2J1Up0o1ali9rq1mJ8CDjA fN2yElFSv626Yc8uQRJ7/bNKGrkHRdGpG7KMEn5zz86AQQKnQtgD7O3JX2Dw9q0T8pfEQRQxcQexA +Gc0x/zIVptebBToOLvHPX3dehsuIGGuiQFsBWp4Jq3fpj7mxBaCThXEJyHe36Lom/IBPv2kK4eBZ jz+klXngn0ZKNMRdbDTyK9luz8ZWwjYJFDKaAMaUVLspDM65yxEE7+YmneswirDAskcOmvhR8A4uH Z9isnpIQQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkTVf-0003Wq-ML; Wed, 02 Dec 2020 14:53:35 +0000 Received: from mxout70.expurgate.net ([91.198.224.70]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkTVZ-0003Ui-N3 for openwrt-devel@lists.openwrt.org; Wed, 02 Dec 2020 14:53:30 +0000 Received: from [127.0.0.1] (helo=localhost) by relay.expurgate.net with smtp (Exim 4.92) (envelope-from ) id 1kkTVY-0003q6-H7; Wed, 02 Dec 2020 15:53:28 +0100 Received: from [195.243.126.94] (helo=securemail.tdt.de) by relay.expurgate.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kkTVX-000JHa-Tc; Wed, 02 Dec 2020 15:53:27 +0100 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 9BF89240041; Wed, 2 Dec 2020 15:53:27 +0100 (CET) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 358DD240040; Wed, 2 Dec 2020 15:53:27 +0100 (CET) Received: from feckert.dev.tdt.de (unknown [10.2.3.40]) by mail.dev.tdt.de (Postfix) with ESMTPSA id 0CC9120046; Wed, 2 Dec 2020 15:53:27 +0100 (CET) From: Florian Eckert To: daniel@makrotopia.org, john@phrozen.org Subject: [PATCH 4/5] firewall: use new restart_service callback Date: Wed, 2 Dec 2020 15:52:32 +0100 Message-ID: <20201202145233.10463-5-fe@dev.tdt.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201202145233.10463-1-fe@dev.tdt.de> References: <20201202145233.10463-1-fe@dev.tdt.de> MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.dev.tdt.de X-purgate-type: clean X-purgate-ID: 151534::1606920808-000040F5-15770307/0/0 X-purgate: clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201202_095329_888124_7DBC878B X-CRM114-Status: GOOD ( 11.77 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [91.198.224.70 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openwrt-devel@lists.openwrt.org, aaronjg@alumni.stanford.edu, Florian Eckert , Florian.Eckert@googlemail.com Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org In order that the prcod restart service can also be triggered during a firewall restart, this call function must be changed. Signed-off-by: Florian Eckert --- package/network/config/firewall/files/firewall.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/config/firewall/files/firewall.init b/package/network/config/firewall/files/firewall.init index 4c2fb7b617..089b02bb4c 100755 --- a/package/network/config/firewall/files/firewall.init +++ b/package/network/config/firewall/files/firewall.init @@ -37,7 +37,7 @@ service_triggers() { procd_close_validate } -restart() { +restart_service() { fw3 restart } From patchwork Wed Dec 2 14:52:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Eckert X-Patchwork-Id: 1409777 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=dev.tdt.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=G4lJGK3u; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CmMT63bmSz9sPB for ; Thu, 3 Dec 2020 01:55:06 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NbCoGaSfBFuEJSD6G5mZu2oXpRdzfgtNFrdRzS2VIi8=; b=G4lJGK3uXKGGNt7YDHww/sMC0 zrZ671s9csvza1mWagh/vza585J3deupvMys3nHsoQkFQ3RmFqFHFOw63JI922/nFefMp50ltdL/L DKeRpccEzj+5FBEvGSJh9WIoAMIhJdhaqAUMIORP6LFDnmYgSjaFqgA+v1Ibbe2n7TZes6oOZiRuz 5DWD62uv1b41sPlx3SrgHtP3eNSRnX/xfGBnv2xgZkE1RwkaKVX6QR9c12LUAjIgHnh4jYNo5+shU bKSNmqbcWPW48Xz9o0mZinsSBvC0ENR1PAgE9fddkigtAuivOV4+rZQ4cZ49bPrH4M1ZheYQBNtQ5 cXxvwWQiw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkTVh-0003XV-Rb; Wed, 02 Dec 2020 14:53:37 +0000 Received: from mxout70.expurgate.net ([194.37.255.70]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkTVc-0003Vl-V4 for openwrt-devel@lists.openwrt.org; Wed, 02 Dec 2020 14:53:34 +0000 Received: from [127.0.0.1] (helo=localhost) by relay.expurgate.net with smtp (Exim 4.90) (envelope-from ) id 1kkTVb-0008Jh-B9; Wed, 02 Dec 2020 15:53:31 +0100 Received: from [195.243.126.94] (helo=securemail.tdt.de) by relay.expurgate.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90) (envelope-from ) id 1kkTVa-0008Sg-N0; Wed, 02 Dec 2020 15:53:30 +0100 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 548A0240041; Wed, 2 Dec 2020 15:53:30 +0100 (CET) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id E06B4240040; Wed, 2 Dec 2020 15:53:29 +0100 (CET) Received: from feckert.dev.tdt.de (unknown [10.2.3.40]) by mail.dev.tdt.de (Postfix) with ESMTPSA id 87C0320046; Wed, 2 Dec 2020 15:53:29 +0100 (CET) From: Florian Eckert To: daniel@makrotopia.org, john@phrozen.org Subject: [PATCH 5/5] procd: add api wrapper Date: Wed, 2 Dec 2020 15:52:33 +0100 Message-ID: <20201202145233.10463-6-fe@dev.tdt.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201202145233.10463-1-fe@dev.tdt.de> References: <20201202145233.10463-1-fe@dev.tdt.de> MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.dev.tdt.de X-purgate-type: clean X-purgate-ID: 151534::1606920811-000064E4-F1EAD650/0/0 X-purgate: clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201202_095333_193918_2CAEAAB3 X-CRM114-Status: GOOD ( 10.85 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [194.37.255.70 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openwrt-devel@lists.openwrt.org, aaronjg@alumni.stanford.edu, Florian Eckert , Florian.Eckert@googlemail.com Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This commit add a wrapper for procd services, to add a callback script if the "service.restart" trigger event was fired. Example: service_trigger() { procd_add_trigger procd_add service_trigger "service.restart" "firewall"