From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id YOvpKRlaN2QJlgAASxT56A (envelope-from ) for ; Thu, 13 Apr 2023 03:25:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id qLX2KBlaN2ThewEAG6o9tA (envelope-from ) for ; Thu, 13 Apr 2023 03:25:45 +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 71F3E3A810 for ; Thu, 13 Apr 2023 03:25:45 +0200 (CEST) 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 Content-Transfer-Encoding: 8bit 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681349145; a=rsa-sha256; cv=none; b=KAPVZXWTw1lh79eB3C19EAjCAkq2TL3R3/hceIupNm6/9qBG+/da6fBnIfbg+L0CB8lAWO H17Lh/u+Q1KN4oACCx08TtJqVvz5TW5GSPaXP4FAJWlfQPohGL2jRrYGK7SqeFdnHw1vwG cWGsdb264VfYVDpX678F97q9Qxld79zC4DHMu1JF4gZ33Y4wmEgmdXRrxWpKGuy5CrolQx /G9gFcwEhIAMmLR5cB5v/OXTxdUzvRaIsyu/pSkcWssLHar0zxOa8MlqEh7JcL+oKUgnA+ Wg3Lwoz+YT9RJDP7nJ26SgA0D2wfK5K8lfMdV7tgjZMpWqzxks3CxP/LMlJQZQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=F8ZLnRFA; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681349145; h=from:from:sender:sender: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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=/oLdcWqObvN0tAoohB66ma2M+2OuUUxyvmJ+2vHofrw=; b=bYyPMxS74V87PHF7LkmJBVYgSimxNTEePsCiWKvsjPSztb8eQGpF9rw6B3vXD4yHc+fHXw aUV2V3vFmfZ442pZwg/Vlh3/pAD1/L0pg4yOgTIA+BDtUZRv6dlIVrTWTwIirqIjWF8Nx6 h+IESqbZ3EjSwAWF5hMx2oxf+c/+kz18BWi3eqS2RCxge9aR1exq7e5dM4elChxbI4Ffbq zArWANRAQpTbKuS/dek9Fze9IUl4MaiTVjMycDSMSCHKQytIfmexBAQiw1jjR8Uy9+sGd9 JnRUZBK/E9O/0amU7kZwMV5cIZqb+W+IkfGIdASf1RjK53CCkgGIQzmjqB4QMQ== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -1.62 X-Spam-Score: -1.62 X-Migadu-Queue-Id: 71F3E3A810 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=F8ZLnRFA; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) X-TUID: C9hjxNRytE3Q * 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)) -- 2.39.2