From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id QPKMCYqiQ2NnFgAAbAwnHQ (envelope-from ) for ; Mon, 10 Oct 2022 06:41:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 8E1yCYqiQ2NYKAAAauVa8A (envelope-from ) for ; Mon, 10 Oct 2022 06:41:46 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C3C1E5503 for ; Mon, 10 Oct 2022 06:41:45 +0200 (CEST) Received: from localhost ([::1]:52608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohkbo-0006KW-UK for larch@yhetil.org; Mon, 10 Oct 2022 00:41:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohkb8-0006K0-OV for guix-patches@gnu.org; Mon, 10 Oct 2022 00:41:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46269) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ohkb8-0008RD-G5 for guix-patches@gnu.org; Mon, 10 Oct 2022 00:41:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ohkb8-0000Ya-As for guix-patches@gnu.org; Mon, 10 Oct 2022 00:41:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58405] [PATCH] services: nginx: Add reload action Resent-From: EuAndreh Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 10 Oct 2022 04:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58405 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58405@debbugs.gnu.org Cc: EuAndreh X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16653768292083 (code B ref -1); Mon, 10 Oct 2022 04:41:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 Oct 2022 04:40:29 +0000 Received: from localhost ([127.0.0.1]:45347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohkaa-0000XX-Tg for submit@debbugs.gnu.org; Mon, 10 Oct 2022 00:40:29 -0400 Received: from lists.gnu.org ([209.51.188.17]:49424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohkaZ-0000XO-BP for submit@debbugs.gnu.org; Mon, 10 Oct 2022 00:40:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohkaY-0006HG-TC for guix-patches@gnu.org; Mon, 10 Oct 2022 00:40:27 -0400 Received: from box.euandre.org ([46.101.160.115]:49551) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ohkaX-0008Iy-1M for guix-patches@gnu.org; Mon, 10 Oct 2022 00:40:26 -0400 Received: from authenticated-user (box.euandre.org [46.101.160.115]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by box.euandre.org (Postfix) with ESMTPSA id C1210FC3D4; Mon, 10 Oct 2022 01:39:49 -0300 (-03) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=euandre.org; s=mail; t=1665376790; bh=1lyHw7/3zgNoZ7hno+DURF3kWONiuZHb/eceFkD3Hu4=; h=From:To:Cc:Subject:Date:From; b=gBeZQlS2RKZ1gdTgqu88vfQqMjJMZDzHTZreUjWQP5N14vfioLFq9kk9QjCLm+OBQ tPtLucjdssjZIwd8fIbTP0G4pMBjVzSxwp1zLLYqNHI1KY/4LTyEs5kc3ijuzas3cV IK6bl9jtiZC7B8Mhft3HD7cVQStvt+YbfH0CMie8OwvVIoq8sJwT2+G5AkEmxnAVdw fDVE3kB3jk9TCe+45vINwSrJkzwSMyzpiXsoxsbyzTOL/DEir2LZlqUmsPkR+Fex3w t09RHMo6o1BW2VnJspNQI/8LCxVtPPJt6pzMRFKsePcUbs5i/DNrHoobm2WX+/RyeH ehMHWIZpyc1WA== Date: Mon, 10 Oct 2022 01:39:32 -0300 Message-Id: <20221010043932.28384-1-eu@euandre.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=46.101.160.115; envelope-from=eu@euandre.org; helo=box.euandre.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: EuAndreh X-ACL-Warn: , EuAndreh via Guix-patches From: EuAndreh via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1665376906; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=BtDxtwSJeAOK5EaO9Oyc8nlBIxTJEJiB2OCOJePTqt4=; b=fk/rkompWgOIrXUJSBC+ZtgOMeuelHJWb5PPS5+jYv6rjXhC+wMSZwkk8qcQfdGMFkLalc kiXkQvdxu8AM2gL1yB26050ZzxolpzRFCupcmFvPFPETkDizKbjn15SVEG5aGG9xXqpm6q xrHsWoVqqPm03as/UelQjuPhsWOouNMEgoaj1Esxh+1IP/jojYccn/Ln5REpB8lBj8/bBG CKS/+GrUsBecxPeymmPiZGoHz6MP5WA3fCAKbI2saNLAfQ45rzCacF4J7In7fpdwiEZXIK qFtv25KggQssUA3oaBO0RBKqZOlA+1AoCIxUQrcX0b/m/C8i2TmW3KAwyEfvhQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665376906; a=rsa-sha256; cv=none; b=O09RxLLWxDWrplXlrlAPVNS/lsA17T1ECUw4uZP3x82yXaHP1luaFYN5Y0n6H02e3s5rGk uJDGlhijd/Olv1W6757YiHOArILN0RC7VByLPiNvOV8vtsnIohYHIVWRkkuZztbkMlqI85 bxKPZoOZSZkwC0H5zvg0dPFGlQ1Lg6yxMOd1gsUchkG0h+sdnw/9pNYqNniyx/pdc9fOxN 2FnlndomSeSB7KeLtlLfKZj1eTcm4kc5hv4sXnhtuwA84VaQegh8QJcjv3PuQA2rOFIAUH zKpfidHS+74Ap46EJRKwC6+cJJcdMTFa9isMnTqmUAYz6JTwruzvhtca9oT+dg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=euandre.org header.s=mail header.b=gBeZQlS2; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.98 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=euandre.org header.s=mail header.b=gBeZQlS2; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: C3C1E5503 X-Spam-Score: -2.98 X-Migadu-Scanner: scn0.migadu.com X-TUID: NpXSEgVPeJdv In a new "reload" shepherd-action, send a SIGHUP to the NGINX master process, so that it can re-read the configuration file and start new worker processes. * gnu/services/web.scm (nginx-shepherd-service): Add the "reload" shepherd-action --- gnu/services/web.scm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index e5ab1a1180..227a577de3 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -807,7 +807,6 @@ (define (nginx-shepherd-service config) #~#t #~(read-pid-file #$pid-file)))))))) - ;; TODO: Add 'reload' action. (list (shepherd-service (provision '(nginx)) (documentation "Run the nginx daemon.") @@ -815,7 +814,19 @@ (define (nginx-shepherd-service config) (modules `((ice-9 match) ,@%default-modules)) (start (nginx-action "-p" run-directory)) - (stop (nginx-action "-s" "stop"))))))) + (stop (nginx-action "-s" "stop")) + (actions + (list + (shepherd-action + (name 'reload) + (documentation "Reload NGINX configuration file and restart worker processes.") + (procedure + #~(lambda (pid) + (if pid + (begin + (kill pid SIGHUP) + (format #t "Service NGINX (PID ~a) has been reloaded." pid)) + (format #t "Service NGINX is not running.")))))))))))) (define nginx-service-type (service-type (name 'nginx) -- 2.37.3