From patchwork Thu Apr 13 01:24:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 49130 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4485B174F9; Thu, 13 Apr 2023 02:25:46 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8D4F2173E2 for ; Thu, 13 Apr 2023 02:25:45 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pmli0-0007q8-Ka; Wed, 12 Apr 2023 21:25:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pmlhy-0007ni-JA for guix-patches@gnu.org; Wed, 12 Apr 2023 21:25:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pmlhu-0004Wb-Ur for guix-patches@gnu.org; Wed, 12 Apr 2023 21:25:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pmlhu-0008Fd-Qq for guix-patches@gnu.org; Wed, 12 Apr 2023 21:25:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62802] [PATCH 2/4] services: syslog: Add a reload action. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 Apr 2023 01:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62802 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62802@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 62802-submit@debbugs.gnu.org id=B62802.168134907831648 (code B ref 62802); Thu, 13 Apr 2023 01:25:02 +0000 Received: (at 62802) by debbugs.gnu.org; 13 Apr 2023 01:24:38 +0000 Received: from localhost ([127.0.0.1]:42137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pmlhW-0008EO-8L for submit@debbugs.gnu.org; Wed, 12 Apr 2023 21:24:38 -0400 Received: from mail-qt1-f182.google.com ([209.85.160.182]:41623) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pmlhU-0008Dy-Ag for 62802@debbugs.gnu.org; Wed, 12 Apr 2023 21:24:37 -0400 Received: by mail-qt1-f182.google.com with SMTP id a23so9980327qtj.8 for <62802@debbugs.gnu.org>; Wed, 12 Apr 2023 18:24:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681349070; x=1683941070; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/oLdcWqObvN0tAoohB66ma2M+2OuUUxyvmJ+2vHofrw=; b=F8ZLnRFAB7GVrHZL0//82lXH0ZktAEzoY7aQvrVAz3lurkO8szi7tWMPNbzY9UvSFH 462hToHpQkaO3GqEHHPKlQI2ZC/0wLoA/13T1EHn24ofeQa9BMwdchrJwY7EOKiRdwJ2 D25sDivgQQIL4iSFLuReKtVrbW/y85I6jWO/Q+A4YI8awqVGGiCS8LBOiJtDYXQv4GWq ParYIijcy1uEw22O0Akbvjm4p7PVIXyioBRL3Hh1ihAlu9Jp13gtO8foth/w9Zf4124D CTtSOumVjdNG4oXb7D3PVCoO8wwyIWRjcfalWGzxKN24RLhn/BXsooCc7zzIUtY9sraK 1aTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681349070; x=1683941070; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/oLdcWqObvN0tAoohB66ma2M+2OuUUxyvmJ+2vHofrw=; b=k+5oTRbF+XhxbqperzHtnnrdBJFzmspTr7InFK3gj5YSPNx5PBPU6+UictMPP189AR LT2UE0JDli3MOE9bo2aIZM1qro9ds24kxIqPsWf0Y/42hwSO2qw7RqzjFfUfMuxLuaU+ YjwE1MXVV5oUpj+L+k1DIl6yuWbejqw9LFdOanz0qpKGahnlPTPkKmz3+5CflsQrmald AdMhAHTo9gWaE3mJ/uWZGoF5JMpe3Ld7LU4rTd53kGJrM/iZqi/hqQMWot8/DkndX24x qTWkF1jxPEVohftp8Ff7RYshPUaZDgrRpwj3In4E8qWbQUmEOlOEfpoN840yPq7vtvtE cQ5A== X-Gm-Message-State: AAQBX9cLpTSjxka1W00ABv+uDNu3jSylxDF6OWw9ITbCyC5QijKr/6Lm 5kWLZvTCDd3roRCs98lXhm7ulddYVrA= X-Google-Smtp-Source: AKy350aI/GDDXmPepigUwaZAJOwB4Jn4XuYrbExR3hcauTPqopuSV5wO3IDNMKo89wSwgX/r3fMGrw== X-Received: by 2002:ac8:7d94:0:b0:3b8:6ca4:bb23 with SMTP id c20-20020ac87d94000000b003b86ca4bb23mr885415qtd.15.1681349070491; Wed, 12 Apr 2023 18:24:30 -0700 (PDT) Received: from localhost.localdomain (dsl-152-224.b2b2c.ca. [66.158.152.224]) by smtp.gmail.com with ESMTPSA id l22-20020ac81496000000b003e4c6b2cc35sm142505qtj.24.2023.04.12.18.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 18:24:30 -0700 (PDT) From: Maxim Cournoyer Date: Wed, 12 Apr 2023 21:24:05 -0400 Message-Id: <20230413012408.2759-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230413012408.2759-1-maxim.cournoyer@gmail.com> References: <20230413012408.2759-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/base.scm (syslog-service-type) [actions]: Add a reload action. * doc/guix.texi (Base Services): Document it. --- doc/guix.texi | 12 ++++++++++++ gnu/services/base.scm | 16 +++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index acb6f0c2e1..70909917a5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18573,6 +18573,18 @@ Type of the service that runs the syslog daemon, whose value is a @code{} object. @end defvar +To have a modified @code{syslog-configuration} come into effect after +reconfiguring your system, the @samp{reload} action should be preferred +to restarting the service, as many services such as the login manager +depend on it and would be restarted as well: + +@example +# herd reload syslog +@end example + +which will cause the running @command{syslogd} process to reload its +configuration. + @deftp {Data Type} syslog-configuration Data type representing the configuration of the syslog daemon. diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 1ed874aa84..db7a0bbc56 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1543,7 +1543,21 @@ (define config-file (documentation "Run the syslog daemon (syslogd).") (provision '(syslogd)) (requirement '(user-processes)) - (actions (list (shepherd-configuration-action syslog.conf))) + (actions + (list (shepherd-configuration-action syslog.conf) + (shepherd-action + (name 'reload) + (documentation "Reload the configuration file from disk.") + (procedure + #~(lambda (pid) + (if pid + (begin + (kill pid SIGHUP) + (display #$(G_ "Service syslog has been asked to \ +reload its settings file."))) + (display #$(G_ "Service syslog is not running.")))))))) + ;; Note: a static file name is used for syslog.conf so that the reload + ;; action work as intended. (start #~(let ((spawn (make-forkexec-constructor (list #$(syslog-configuration-syslogd config) #$(string-append "--rcfile=" syslog.conf))