From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 15 19:46:25 2021 Received: (at submit) by debbugs.gnu.org; 15 Sep 2021 23:46:25 +0000 Received: from localhost ([127.0.0.1]:53442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQeba-000620-Pt for submit@debbugs.gnu.org; Wed, 15 Sep 2021 19:46:25 -0400 Received: from lists.gnu.org ([209.51.188.17]:52614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQebY-00061s-Ia for submit@debbugs.gnu.org; Wed, 15 Sep 2021 19:46:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQebY-0005Tt-4V for guix-patches@gnu.org; Wed, 15 Sep 2021 19:46:16 -0400 Received: from mx.kolabnow.com ([95.128.36.42]:16414 helo=ext-mx-out001.mykolab.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQebV-0001Cr-KG for guix-patches@gnu.org; Wed, 15 Sep 2021 19:46:15 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out001.mykolab.com (Postfix) with ESMTP id 16FE3A25 for ; Thu, 16 Sep 2021 01:46:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:mime-version :message-id:date:date:subject:subject:from:from:received :received:received; s=dkim20160331; t=1631749568; x=1633563969; bh=z8kb+v9RiHX7N/VOvxv+tDyRL4Bz7n07+sYHixwE+ic=; b=evfBBkwuqrkn jT3qpnHO6CWnNAGl/cvemFCnf80fk5CYam3A/OuQA/AvXYXZx9MjudfIXFwLEfU0 q0u4vqLx/hnoMkaxgBueFlnW/u0edyaQaYGl0W+rfl1kATK4TxmszW3gtiNbBNRN jSv976TbwXaLFZh8bAxb7TUrPeAjQCeI0kW4P0ST7e8cumIl2inb5A5qrbBizfs3 XmhzK9trHGdLn244IeIyaWigcbjdPPML09RZJYj6lIvxnK7ugqkvzwc89PI/hrHF jgYZuowFZBbCWs3O1bGmbCJ1FCp8NH6RfuuMpsgsyjqWbNQInmY8DqpiZRShDYby BvJBznbgcm9HWLgsDyzp0yucHVAWo/waMYJyRdSeMD+z3T54D6G7rhttErmGvz8B f04vCxcMjCaRl5qGF5aoUM05E+edFmUjnnValPBzG19a2UQ9PQqOUCOr2mkLW9xV 8pFPEU4j22A+9hEDXHc4ulzn9e2TRvmUH+tmG6szk10enfyjXb2qDg80K0B7D0HD opVmvF9Eg9X4uDv5j4/93Q06YpciHFsOFNyvaBVi2kk9hGSz5yP0cDXxuE+qubmA yI06g89a66gBulwDpyBLTlLwyVidOdJ5ibtMZ+2OUm9rmZ5rDEX3kOOE8D9ImMRr AtSYcoJoCAREAoDq7J+ag4GkuCLT2QQ= X-Virus-Scanned: amavisd-new at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1.899 X-Spam-Level: X-Spam-Status: No, score=-1.899 tagged_above=-10 required=5 tests=[BAYES_00=-1.9, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no Received: from ext-mx-out001.mykolab.com ([127.0.0.1]) by localhost (ext-mx-out001.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2PNOO_U-Zqvr for ; Thu, 16 Sep 2021 01:46:08 +0200 (CEST) Received: from int-mx003.mykolab.com (unknown [10.9.13.3]) by ext-mx-out001.mykolab.com (Postfix) with ESMTPS id 23E18702 for ; Thu, 16 Sep 2021 01:46:08 +0200 (CEST) Received: from ext-subm001.mykolab.com (unknown [10.9.6.1]) by int-mx003.mykolab.com (Postfix) with ESMTPS id F06E43AF0; Thu, 16 Sep 2021 01:36:59 +0200 (CEST) From: Thiago Jung Bauermann To: guix-patches@gnu.org Subject: [PATCH] =?UTF-8?q?etc:=20Add=20systemd=20files=20for=20running=20?= =?UTF-8?q?=E2=80=98guix=20gc=E2=80=99=20periodically?= Date: Wed, 15 Sep 2021 20:36:38 -0300 Message-Id: <20210915233638.67470-1-bauermann@kolabnow.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=95.128.36.42; envelope-from=bauermann@kolabnow.com; helo=ext-mx-out001.mykolab.com 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_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: Thiago Jung Bauermann X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) * etc/guix-gc.service.in: New file. * etc/guix-gc.timer: Likewise. * .gitignore: Ignore generated ‘guix-gc.service’. * nix/local.mk (nodist_systemdservice_DATA): Add ‘guix-gc.service’ and ‘guix-gc.timer’. (EXTRA_DIST): Add ‘guix-gc.service.in’ and ‘guix-gc.timer’. * doc/guix.texi (Binary Installation): Mention the new systemd files. --- Hello, I recently added a systemd timer to run ‘guix gc’ once a day on the guixp9 CI machine. This patch adds files similar to the ones I used there, and documents them. The only differences are that on guixp9 the command-line used is “guix gc -F 50G” and the timer is set to fire daily rather than weekly. Thanks, Thiago .gitignore | 1 + doc/guix.texi | 12 ++++++++++++ etc/guix-gc.service.in | 20 ++++++++++++++++++++ etc/guix-gc.timer | 15 +++++++++++++++ nix/local.mk | 6 +++++- 5 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 etc/guix-gc.service.in create mode 100644 etc/guix-gc.timer diff --git a/.gitignore b/.gitignore index 88fe24586db0..59e1460fefc8 100644 --- a/.gitignore +++ b/.gitignore @@ -74,6 +74,7 @@ /etc/guix-daemon.service /etc/guix-publish.conf /etc/guix-publish.service +/etc/guix-gc.service /etc/init.d/guix-daemon /etc/openrc/guix-daemon /guix-* diff --git a/doc/guix.texi b/doc/guix.texi index 2fc96879106b..e1e353e57e50 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -743,6 +743,18 @@ with these commands: # systemctl enable --now gnu-store.mount guix-daemon @end example +You may also want to arrange for @command{guix gc} to run periodically: + +@example +# cp ~root/.config/guix/current/lib/systemd/system/guix-gc.service \ + ~root/.config/guix/current/lib/systemd/system/guix-gc.timer \ + /etc/systemd/system/ +# systemctl enable --now guix-gc.timer +@end example + +You may want to edit @file{guix-gc.service} to adjust the command line +options to fit your needs (@pxref{Invoking guix gc}). + If your host distro uses the Upstart init system: @example diff --git a/etc/guix-gc.service.in b/etc/guix-gc.service.in new file mode 100644 index 000000000000..2f1ca6584bbc --- /dev/null +++ b/etc/guix-gc.service.in @@ -0,0 +1,20 @@ +# This is a "service unit file" for the systemd init system to perform a +# one-shot 'guix gc' operation. It is meant to be triggered by a timer. +# Drop it in /etc/systemd/system or similar together with 'guix-gc.timer' +# to set it up. + +[Unit] +Description=Discard unused Guix store items + +[Service] +Type=oneshot +# Customize the 'guix gc' arguments to fit your needs. +ExecStart=@localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix gc -d 1m -F 10G +PrivateDevices=yes +PrivateNetwork=yes +PrivateUsers=no +ProtectKernelTunables=yes +ProtectKernelModules=yes +ProtectControlGroups=yes +MemoryDenyWriteExecute=yes +SystemCallFilter=@default @file-system @basic-io @system-service diff --git a/etc/guix-gc.timer b/etc/guix-gc.timer new file mode 100644 index 000000000000..192132fbda51 --- /dev/null +++ b/etc/guix-gc.timer @@ -0,0 +1,15 @@ +# This is a "timer unit file" for the systemd init system to trigger +# 'guix-gc.service' periodically. Drop it in /etc/systemd/system or similar +# together with 'guix-gc.service' to set it up. + +[Unit] +Description=Discard unused Guix store items + +[Timer] +OnCalendar=weekly +AccuracySec=1h +Persistent=true +RandomizedDelaySec=6000 + +[Install] +WantedBy=timers.target diff --git a/nix/local.mk b/nix/local.mk index 7c438ea78c5b..d6b4d7faeb66 100644 --- a/nix/local.mk +++ b/nix/local.mk @@ -153,7 +153,9 @@ systemdservicedir = $(libdir)/systemd/system nodist_systemdservice_DATA = \ etc/gnu-store.mount \ etc/guix-daemon.service \ - etc/guix-publish.service + etc/guix-publish.service \ + etc/guix-gc.service \ + etc/guix-gc.timer etc/%.mount: etc/%.mount.in \ $(top_builddir)/config.status @@ -216,6 +218,8 @@ EXTRA_DIST += \ etc/guix-daemon.conf.in \ etc/guix-publish.service.in \ etc/guix-publish.conf.in \ + etc/guix-gc.service.in \ + etc/guix-gc.timer \ etc/init.d/guix-daemon.in \ etc/openrc/guix-daemon.in From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 10:19:41 2021 Received: (at 50610-done) by debbugs.gnu.org; 20 Sep 2021 14:19:41 +0000 Received: from localhost ([127.0.0.1]:43766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSK8z-0003pR-7V for submit@debbugs.gnu.org; Mon, 20 Sep 2021 10:19:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47936) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSK8x-0003pA-0T for 50610-done@debbugs.gnu.org; Mon, 20 Sep 2021 10:19:39 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:32870) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSK8r-0000Z7-MK; Mon, 20 Sep 2021 10:19:33 -0400 Received: from [109.110.20.156] (port=47424 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSK8r-00026e-05; Mon, 20 Sep 2021 10:19:33 -0400 From: Mathieu Othacehe To: Thiago Jung Bauermann Subject: Re: bug#50610: [PATCH] etc: Add systemd files for running =?utf-8?B?4oCYZ3VpeCBnY+KAmQ==?= periodically References: <20210915233638.67470-1-bauermann@kolabnow.com> Date: Mon, 20 Sep 2021 14:19:31 +0000 In-Reply-To: <20210915233638.67470-1-bauermann@kolabnow.com> (Thiago Jung Bauermann's message of "Wed, 15 Sep 2021 20:36:38 -0300") Message-ID: <87ee9js51o.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50610-done Cc: 50610-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello Thiago, > I recently added a systemd timer to run =E2=80=98guix gc=E2=80=99 once a = day on the guixp9 CI > machine. This patch adds files similar to the ones I used there, and docu= ments > them. The only differences are that on guixp9 the command-line used is > =E2=80=9Cguix gc -F 50G=E2=80=9D and the timer is set to fire daily rathe= r than weekly. Looks nice, pushed as 5c4fd77097e2cecfd4780e099af7954f86779fe1. Thanks, Mathieu From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 21:18:53 2021 Received: (at 50610-done) by debbugs.gnu.org; 21 Sep 2021 01:18:53 +0000 Received: from localhost ([127.0.0.1]:44375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSUQv-0006LC-J7 for submit@debbugs.gnu.org; Mon, 20 Sep 2021 21:18:53 -0400 Received: from mx.kolabnow.com ([95.128.36.40]:60140 helo=ext-mx-out003.mykolab.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSUQu-0006Kx-1X for 50610-done@debbugs.gnu.org; Mon, 20 Sep 2021 21:18:52 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out003.mykolab.com (Postfix) with ESMTP id 4AABD40D32; Tue, 21 Sep 2021 03:18:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:date:subject:subject :from:from:received:received:received; s=dkim20160331; t= 1632187126; x=1634001527; bh=t6fKK8RYw0wKh+g4r0JqcJA8d0b6k4uKhSQ x7F61bMs=; b=QBJAkjs5Cqh/leDJXF/Sd+/pSZAZ6wO/Aee/W61yYUGTo6/iLqT ymnCidpqPj88CTD0w2rm5WrQ4D4fdF/4dyQOGqFpZzdTDsMlISKiCs3UJDQa87s0 a+V9zl17PMS2twhWFkVHwB1g50Zj6KPaaYb9Ch0YWImHyI7sgdS6A6cCxoOAKnln gk3JsjQiIrtPfYcyTxRksKJWgaF+MT9+HM2MPUtsoWLJh0YB0gcmkWFQVLI9XEsv gwvEDTgcaY605PkK3lQcUXcJLeiojo6u052WS90xetL7bkZVZh5bKrz7nAD4CJYI X4UjAJCh0BESpxhKHFr6Qvl079mtFlfutw7WNOIO2EJmeJ9YB2fJbwGMKRUTLqt9 Y0VdILILR8N6XUWFK3xywn4H1YbTe8vlaLwM69M0SWwsSsS5d2mXRJoTBODRTDSL escPvymajoGhJSO3y/tlNdvp/RIEa5AwXZ0dl1Q+lLPb8iESdYcy1+ORcUz8+l0+ TXK4CF7NAf2Mqax/pFtdboWYy2gWFHX7XoO/oPu6QhmMZj93jmF14GzIktMFDsU4 SrXeiVl2ql4Jt5ot7DEWNOgsmO2AdfWf2QRse8R0Xs8y1AakgL9OSimWAD4ocz6e 6yMdQHMlxHvAVRWUkmCkk6Kf9/6ElRegr6/VKX1id8iwABwXl5PVy/uw= X-Virus-Scanned: amavisd-new at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-10 required=5 tests=[BAYES_00=-1.9] autolearn=ham autolearn_force=no Received: from ext-mx-out003.mykolab.com ([127.0.0.1]) by localhost (ext-mx-out003.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Qwfsanng9-x2; Tue, 21 Sep 2021 03:18:46 +0200 (CEST) Received: from int-mx001.mykolab.com (unknown [10.9.13.1]) by ext-mx-out003.mykolab.com (Postfix) with ESMTPS id F057B403ED; Tue, 21 Sep 2021 03:18:45 +0200 (CEST) Received: from ext-subm001.mykolab.com (unknown [10.9.6.1]) by int-mx001.mykolab.com (Postfix) with ESMTPS id 6A22C8B1; Tue, 21 Sep 2021 03:18:45 +0200 (CEST) From: Thiago Jung Bauermann To: Mathieu Othacehe Subject: Re: bug#50610: [PATCH] etc: Add systemd files for running =?UTF-8?B?4oCYZ3VpeCBnY+KAmQ==?= periodically Date: Mon, 20 Sep 2021 22:18:38 -0300 Message-ID: <15260375.WZSMnLsSP3@popigai> In-Reply-To: <87ee9js51o.fsf@gnu.org> References: <20210915233638.67470-1-bauermann@kolabnow.com> <87ee9js51o.fsf@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50610-done Cc: 50610-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Mathieu, Em segunda-feira, 20 de setembro de 2021, =C3=A0s 11:19:31 -03, Mathieu Oth= acehe=20 escreveu: > Hello Thiago, >=20 > > I recently added a systemd timer to run =E2=80=98guix gc=E2=80=99 once = a day on the > > guixp9 CI machine. This patch adds files similar to the ones I used > > there, and documents them. The only differences are that on guixp9 the > > command-line used is =E2=80=9Cguix gc -F 50G=E2=80=9D and the timer is = set to fire > > daily rather than weekly. > Looks nice, pushed as 5c4fd77097e2cecfd4780e099af7954f86779fe1. Thanks! =2D-=20 Thanks, Thiago From unknown Fri Aug 15 04:06:57 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 19 Oct 2021 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator