From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qKKLKUFmwl/vfQAA0tVLHw (envelope-from ) for ; Sat, 28 Nov 2020 15:01:21 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id sD9ZJUFmwl8JVgAAB5/wlQ (envelope-from ) for ; Sat, 28 Nov 2020 15:01:21 +0000 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 096E29405D2 for ; Sat, 28 Nov 2020 15:01:20 +0000 (UTC) Received: from localhost ([::1]:59842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kj1iw-0006kv-Nq for larch@yhetil.org; Sat, 28 Nov 2020 10:01:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kj1iU-0006ka-7T for Help-Guix@gnu.org; Sat, 28 Nov 2020 10:00:51 -0500 Received: from box.euandre.org ([46.101.160.115]:60337) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kj1iR-00072X-Qz for Help-Guix@gnu.org; Sat, 28 Nov 2020 10:00:49 -0500 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 C8B0CFC3DB; Sat, 28 Nov 2020 12:00:10 -0300 (-03) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=euandre.org; s=mail; t=1606575611; bh=SMETNsiWbobR3VFPM5jR2Vcqt00Nqb3ic5eyBTXy3vE=; h=From:To:Cc:Subject:Date:From; b=EXg02d9IubOjfg46ZBNBW0uk0X3xLxo1cABKJ/7nfv5GZd42rYtSYiHmoY8G8KoRv iMf67qLnmgSsDtx5BNzYAzV/TVJ5qcLgyHqzuulIizLm19FbmlVXcmh5G0n5ZDze5R HKBn5VHRP8HsUREUwwmS+P0QfWZoRoEwM993s5xatJLUuiaTRe17h10eXsZ24R9Rgw 7NOzZdu7WG3QPh5Q6eWQt+by1V/4F+p7Wo4O9/JKvp/KucKVjZfcplomK9Xzo6vXEf Zy0BEAb+pvLzjuqLjLK+Dd5pzxPKqobWPo4KV2f3jBJ78S8yLPdz9Mk8mSV3aQRICB vglKKEUU5x/2Q== From: EuAndreh To: help-guix Cc: Subject: Manual: why not restart service over killing the process Date: Sat, 28 Nov 2020 11:58:03 -0300 Message-ID: <87k0u5msuc.fsf@euandre.org> MIME-Version: 1.0 Content-Type: text/plain 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: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.97 X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=euandre.org header.s=mail header.b=EXg02d9I; dmarc=pass (policy=quarantine) header.from=euandre.org; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-TUID: YwtEBqOVA+g6 Hi! The manual suggests a deploy-hook for the certbot-service-type that looks like this: (define %nginx-deploy-hook (program-file "nginx-deploy-hook" #~(let ((pid (call-with-input-file "/var/run/nginx/pid" read))) (kill pid SIGHUP)))) Instead of requiring the deploy-hook to know the path of the PID file, why not restart the Shepherd service instead? Something like this: (define %nginx-deploy-hook (program-file "nginx-deploy-hook" (with-imported-modules '((gnu services herd)) #~(begin (use-modules (gnu services herd)) (restart-service 'nginx))))) If I understood correctly, those would result in equivalent outcomes, and I tend to find the latter a more elegant approach. It is a bit longer, but I like more restarting the service rather than killing the process. Is there any downside I'm missing? I can send a patch to the manual if this seems reasonable.