From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2HI5HB+9wF+zXQAA0tVLHw (envelope-from ) for ; Fri, 27 Nov 2020 08:47:27 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id SDX3Fx+9wF8aEwAAbx9fmQ (envelope-from ) for ; Fri, 27 Nov 2020 08:47:27 +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 C238D9401BF for ; Fri, 27 Nov 2020 08:47:26 +0000 (UTC) Received: from localhost ([::1]:34466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kiZPZ-0003Wb-Jn for larch@yhetil.org; Fri, 27 Nov 2020 03:47:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kiZPC-0003WA-8j for guix-patches@gnu.org; Fri, 27 Nov 2020 03:47:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60604) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kiZPB-0007fb-Rz for guix-patches@gnu.org; Fri, 27 Nov 2020 03:47:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kiZPB-0004jp-Pw for guix-patches@gnu.org; Fri, 27 Nov 2020 03:47:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44900] [PATCH] services: unattended-upgrade: Add 'search-paths' field. Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 27 Nov 2020 08:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44900 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 44900@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160646680218185 (code B ref -1); Fri, 27 Nov 2020 08:47:01 +0000 Received: (at submit) by debbugs.gnu.org; 27 Nov 2020 08:46:42 +0000 Received: from localhost ([127.0.0.1]:43917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kiZOs-0004jD-DC for submit@debbugs.gnu.org; Fri, 27 Nov 2020 03:46:42 -0500 Received: from lists.gnu.org ([209.51.188.17]:33380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kiZOq-0004j6-HI for submit@debbugs.gnu.org; Fri, 27 Nov 2020 03:46:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kiZOq-0003HP-9N for guix-patches@gnu.org; Fri, 27 Nov 2020 03:46:40 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:38635) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kiZOn-0007UH-MS for guix-patches@gnu.org; Fri, 27 Nov 2020 03:46:40 -0500 Received: by mail-wm1-x334.google.com with SMTP id 1so5743691wme.3 for ; Fri, 27 Nov 2020 00:46:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leibniz-psychology-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition; bh=7TSTk+DE9UH7VO4LrjbR5r2MSTqLjpJo9j6jGVoVnpg=; b=JwEt6IeFYe0GT/HoBjh2FHMVJt0zRH+I0KaK9yiFkt6HYR4hNo9unlcky9zbRkeIXw sTZHLT91bKU0rXrrUMmyxItsT6cbMScZiF27EpyTZ8UvWeQX4lqjVrpZotRhYkDwmGky TcO1sUhcBKXwnw/teF+v06MXv/UebABEUY24BgVKXl5zIvyp5QhWHkJU35LytnNihcYh 6+4AET/uFHBpE7hheZXtelt1N2CUhHAJ0so5ughZY9fbgQn1tyK25EnC2Pc+qcy2Sk86 piTpo1OvMHCZLl7Mnl2Bv8bjSS5dnHHQFroLLSYcVRdwsjzBaqoGVHMaMMyLzVz3Esbr dvQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=7TSTk+DE9UH7VO4LrjbR5r2MSTqLjpJo9j6jGVoVnpg=; b=ieTsTx0OT+HkAIEHhVv6TzoerBzAfyvqt2HFyqTSbPccgZLbb0Aq0ySv4elccjPKVv YM2k8O/Jey8XTrU/T9XDQbXBU5ceOF58suU82o2Qt9557luJxNLZKaAnqvgeVTkkESIJ Ku2tpCEwIuorw1XD3YzNkLo8cYU0jDjomZbp2ZaEgZXrbtcfICHXRF7i4bqsl13Qy2wE S00QEcr6xCJRTqTbZt0K6QBS3LuNNQBvoku1jtT7hO2R7A7OKlsveVXYRNGoHEEBozZ4 aTHToYpkbhfsIpf3673ifmIJO6fyu4pETJwp/G5/s9pjCEQP2t1bfys2GFGBjMBfwdTs KxBg== X-Gm-Message-State: AOAM53335XhCSRYtv3nKuAImE4h90U7D9NNXyPe78TGcXtbG2Sbau1dQ rFAev5eJMprW2fJPubddMdnxr6a3nh/scS2hIjIeMxaaOEyAlR8YYJeUEBXhPRy6tFtPMdA7Owy Kq7363rKhYbZBCTbcyIDwnIVEd+Z/7qMsSjtEmxBXQxJ5aahRDiP++i56ouRWhVVTxkrGkkewKC hqr9Jt21cm4A== X-Google-Smtp-Source: ABdhPJxN/PkVUZN+BqwJXOI4SpJKXuRvjg4K0L1nO+uDUgs3Vu0MO4hxGuZJnMlN/F4iGAWy2Bx5mw== X-Received: by 2002:a7b:c182:: with SMTP id y2mr7590562wmi.97.1606466794617; Fri, 27 Nov 2020 00:46:34 -0800 (PST) Received: from localhost (dynamic-2a01-0c23-785d-6000-e90a-ad4b-b1e5-f1a2.c23.pool.telefonica.de. [2a01:c23:785d:6000:e90a:ad4b:b1e5:f1a2]) by smtp.gmail.com with ESMTPSA id o5sm12027689wmh.8.2020.11.27.00.46.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Nov 2020 00:46:33 -0800 (PST) Date: Fri, 27 Nov 2020 09:46:32 +0100 From: Lars-Dominik Braun Message-ID: <20201127084632.GA3077@zpidnp36> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pvezYHf7grwyp3Bc" Content-Disposition: inline Received-SPF: none client-ip=2a00:1450:4864:20::334; envelope-from=ldb@leibniz-psychology.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) 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" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.86 X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=leibniz-psychology-org.20150623.gappssmtp.com header.s=20150623 header.b=JwEt6IeF; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-TUID: 80YwLXrTy6Dz --pvezYHf7grwyp3Bc Content-Type: multipart/mixed; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline --UugvWAfsgieZRqgk Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, I=E2=80=99m using a modular machine configuration, i.e. the scheme file ret= urning the operating system definition imports several other custom modules with servi= ce definitions etc in the same directory. This does not work well with unatten= ded upgrades. The attached patch allows adding search paths to the unattended upgrade service. I=E2=80=99m not sure this is the best solution though. May= be the preferred way to add these modules is to a custom channel? The second patch changes the default channels to #f, i.e. the system default (/etc/guix/channels.scm), which feels more natural to me. Cheers, Lars --=20 Lars-Dominik Braun Wissenschaftlicher Mitarbeiter/Research Associate www.leibniz-psychology.org ZPID - Leibniz-Institut f=C3=BCr Psychologie / ZPID - Leibniz Institute for Psychology Universit=C3=A4tsring 15 D-54296 Trier - Germany Tel.: +49=E2=80=93651=E2=80=93201-4964 --UugvWAfsgieZRqgk Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-services-unattended-upgrade-Add-search-paths-field.patch" Content-Transfer-Encoding: quoted-printable =46rom d5dd0da8976211a0d0b77663ae8f8f945e92a7a1 Mon Sep 17 00:00:00 2001 =46rom: Lars-Dominik Braun Date: Fri, 27 Nov 2020 09:32:41 +0100 Subject: [PATCH 1/2] services: unattended-upgrade: Add 'search-paths' field. * gnu/services/admin.scm ()[search-paths]: New field. (unattended-upgrade-mcron-jobs): Honor it. * doc/guix.texi (Unattended Upgrades): Document it. --- doc/guix.texi | 4 ++++ gnu/services/admin.scm | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 32b91272cf..7f42fe8867 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17063,6 +17063,10 @@ This gexp specifies the channels to use for the up= grade (@pxref{Channels}). By default, the tip of the official @code{guix} channel is used. =20 +@item @code{search-paths} (default: @code{'()}) +This list specifies the extra search paths used. By default, no search pa= ths +are added. + @item @code{operating-system-file} (default: @code{"/run/current-system/co= nfiguration.scm"}) This field specifies the operating system configuration file to use. The default is to reuse the config file of the current configuration. diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index b34b990f32..87cf76c57f 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -205,6 +205,8 @@ Old log files are removed or compressed according to th= e configuration.") (default "30 01 * * 0")) (channels unattended-upgrade-configuration-channels (default #~%default-channels)) + (search-paths unattended-upgrade-configuration-search-paths + (default '())) (services-to-restart unattended-upgrade-configuration-services-to-resta= rt (default '(mcron))) (system-expiration unattended-upgrade-system-expiration @@ -219,8 +221,8 @@ Old log files are removed or compressed according to th= e configuration.") =20 (define (unattended-upgrade-mcron-jobs config) (define channels - (scheme-file "channels.scm" - (unattended-upgrade-configuration-channels config))) + (let ((c (unattended-upgrade-configuration-channels config))) + (if c (scheme-file "channels.scm" c) #f))) =20 (define log (unattended-upgrade-configuration-log-file config)) @@ -271,9 +273,15 @@ Old log files are removed or compressed according to t= he configuration.") (format #t "~a starting upgrade...~%" (timestamp)) (guard (c ((invoke-error? c) (report-invoke-error c))) - (invoke #$(file-append guix "/bin/guix") - "time-machine" "-C" #$channels - "--" "system" "reconfigure" #$config-file) + (let* ((channel #$(if channels #~(list "-C" #$channels) (quote '()))) + (search-paths (quote #$(unattended-upgrade-configuratio= n-search-paths config))) + (search-path-args (apply append (map (lambda (x) (list = "-L" x)) search-paths))) + (command (append (list #$(file-append guix "/bin/guix")= "time-machine") + channel + (list "--" "system" "reconfigure") + search-path-args + (list #$config-file)))) + (apply invoke command)) =20 ;; 'guix system delete-generations' fails when there's no ;; matching generation. Thus, catch 'invoke-error?'. --=20 2.25.1 --UugvWAfsgieZRqgk Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0002-services-unattended-upgrade-Change-default-for-chann.patch" Content-Transfer-Encoding: quoted-printable =46rom b425b012533de4a460cf22a14a4fcfbed78c0c2b Mon Sep 17 00:00:00 2001 =46rom: Lars-Dominik Braun Date: Fri, 27 Nov 2020 09:42:11 +0100 Subject: [PATCH 2/2] services: unattended-upgrade: Change default for 'channels' field. * gnu/services/admin.scm ()[channels]: Default to #f. * doc/guix.texi (Unattended Upgrades): Document it. --- doc/guix.texi | 5 ++--- gnu/services/admin.scm | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 7f42fe8867..5168d7d840 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17058,10 +17058,9 @@ This is the schedule of upgrades, expressed as a g= exp containing an mcron job schedule (@pxref{Guile Syntax, mcron job specifications,, mcron, GNU@tie{}mcron}). =20 -@item @code{channels} (default: @code{#~%default-channels}) +@item @code{channels} (default: @code{#f}) This gexp specifies the channels to use for the upgrade -(@pxref{Channels}). By default, the tip of the official @code{guix} -channel is used. +(@pxref{Channels}). By default, the system=E2=80=99s default is used. =20 @item @code{search-paths} (default: @code{'()}) This list specifies the extra search paths used. By default, no search pa= ths diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 87cf76c57f..a1c4abd3e2 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -204,7 +204,7 @@ Old log files are removed or compressed according to th= e configuration.") (schedule unattended-upgrade-configuration-schedule (default "30 01 * * 0")) (channels unattended-upgrade-configuration-channels - (default #~%default-channels)) + (default #f)) (search-paths unattended-upgrade-configuration-search-paths (default '())) (services-to-restart unattended-upgrade-configuration-services-to-resta= rt --=20 2.25.1 --UugvWAfsgieZRqgk-- --pvezYHf7grwyp3Bc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEyk+M9DfXR4/aBV/UQhN3ARo3hEYFAl/AvOUACgkQQhN3ARo3 hEbZmAwAtH/CF1SSg2K4qWunWdxpsErzh+qVcy+kulNVsS2HfLlTmWqYy4fhcTEM JCeunyxaew/juEjtRsyQaj2muNlyrMtMkaDU/hK1cepcfHUx9VyM86Cc0hQC9kxu gnTFIgGiFOLP09SiJsJAJe56wRdO1leYPzrFwG4Jgohn2MUxUgFbCDcD2O1wx7L5 OHkSfZfBocTMD6yUNMs13nVqy+bEJO47NHL4/J9rnwq4aXjd9rrtM1yOsCsW3/Vx ghLmQG9Sj81IOKfvB3PHexAj7Ldp5OuLAcL/yz9BIINTXviJtVf3ieQ+BasPWmvu yUUJp6CYtFAAVwMNQOlNg5a0IU/unJEeLtupuqSBeMhxEBMHgtafsa4YWzqnjNA7 EqqmtbC6n/Y3FudQiYNWVT8rpxV8bzfc2IjPVWeY/yXhCtYOrnFBovQcuPZ81vdZ lau9GAx7AvC7fIAsR0NxZJKG2Kb8Q8ZrqjPOQ2lXl81XyeZO6PVI2wQej9uJ3hbe HeMoxZpb =qJ/n -----END PGP SIGNATURE----- --pvezYHf7grwyp3Bc--