From 985934cb218eaa44b255cfc464b11ce05f691973 Mon Sep 17 00:00:00 2001 From: Martin Castillo Date: Thu, 15 Mar 2018 23:40:58 +0100 Subject: services: openssh: Add 'accepted-environment' field. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/ssh.scm ()[accepted-environment]: New field. (openssh-config-file): Honor 'acccepted-environment'. * doc/guix.texi (Networking Services): Document it. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index bcea89e07b..b768b20d6b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11158,6 +11158,23 @@ server. Alternately, one can specify the @command{sftp-server} command: `(("sftp" ,(file-append openssh "/libexec/sftp-server")))))) @end example +@item @code{accepted-environment} (default: @code{'()}) +List of strings describing which environment variables may be exported. + +Each string gets on its own line. See the @code{AcceptEnv} option in +@code{man sshd_config}. + +This example allows ssh-clients to export the @code{COLORTERM} variable. +It is set by terminal emulators, which support colors. You can use it in +your shell's ressource file to enable colors for the prompt and commands +if this variable is set. + +@example +(service openssh-service-type + (openssh-configuration + (accepted-environment '("COLORTERM")))) +@end example + @item @code{authorized-keys} (default: @code{'()}) @cindex authorized keys, SSH @cindex SSH authorized keys -- cgit v1.2.3 From cfbf6de18cc70d2e385feb5f61f9363f18e78ddf Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 19 Mar 2018 23:16:48 +0100 Subject: gnu: mcron: Update to 1.1 and deprecate "mcron2". * gnu/packages/guile.scm (mcron): Update to 1.1. [native-inputs]: Add TZDATA-FOR-TESTS. [arguments]: New field. (mcron2): Define using 'deprecated-package'. * gnu/services/mcron.scm: Replace 'mcron2' with 'mcron'. * doc/guix.texi (Scheduled Job Execution): Likewise. * gnu/tests/base.scm (%mcron-os): Remove comment about mcron2. --- doc/guix.texi | 4 +- gnu/packages/guile.scm | 116 +++++++++++++++++++------------------------------ gnu/services/mcron.scm | 8 ++-- gnu/tests/base.scm | 4 +- 4 files changed, 53 insertions(+), 79 deletions(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index b768b20d6b..4de8e9cb5a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -10479,7 +10479,7 @@ gexps to introduce job definitions that are passed to mcron for more information on mcron job specifications. Below is the reference of the mcron service. -@deffn {Scheme Procedure} mcron-service @var{jobs} [#:mcron @var{mcron2}] +@deffn {Scheme Procedure} mcron-service @var{jobs} [#:mcron @var{mcron}] Return an mcron service running @var{mcron} that schedules @var{jobs}, a list of gexps denoting mcron job specifications. @@ -10504,7 +10504,7 @@ mcron jobs to run. Data type representing the configuration of mcron. @table @asis -@item @code{mcron} (default: @var{mcron2}) +@item @code{mcron} (default: @var{mcron}) The mcron package to use. @item @code{jobs} diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index ddd34ae7dc..33ef822b16 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -662,18 +662,51 @@ library.") (define-public mcron (package (name "mcron") - (version "1.0.8") + (version "1.1") (source (origin - (method url-fetch) - (uri (string-append "mirror://gnu/mcron/mcron-" - version ".tar.gz")) - (sha256 - (base32 - "0zparwgf01jgl1x53ik71ghabldq6zz18ha4dscps1i0qrzgap1b")) - (patches (search-patches "mcron-install.patch")))) + (method url-fetch) + (uri (string-append "mirror://gnu/mcron/mcron-" + version ".tar.gz")) + (sha256 + (base32 + "1f547sqqfbp0k02sqk4ivwx8y9mx8l0rrx1c9rrj033av073h6xq")))) (build-system gnu-build-system) - (native-inputs `(("pkg-config" ,pkg-config))) - (inputs `(("ed" ,ed) ("which" ,which) ("guile" ,guile-2.0))) + (arguments + '(#:phases (modify-phases %standard-phases + (add-before 'check 'set-timezone + (lambda* (#:key inputs #:allow-other-keys) + ;; 'tests/schedule.sh' expects to be running in UTC+1. + (let ((tzdata (assoc-ref inputs "tzdata"))) + (setenv "TZDIR" + (string-append tzdata + "/share/zoneinfo")) + (setenv "TZ" "UTC+1") + #t))) + (add-before 'check 'disable-schedule-test + (lambda _ + ;; But! As it turns out, that test additionally relies + ;; on non-deterministic behavior; see + ;; . + (substitute* "tests/schedule.sh" + (("mkdir cron") "exit 77\n")) + #t)) + (add-after 'install 'wrap-programs + (lambda* (#:key outputs #:allow-other-keys) + ;; By default mcron doesn't have its own modules in the + ;; search path, so the 'mcron' command fails to start. + (let* ((output (assoc-ref outputs "out")) + (modules (string-append output + "/share/guile/site/2.2")) + (go (string-append output + "/lib/guile/2.2/site-ccache"))) + (wrap-program (string-append output "/bin/mcron") + `("GUILE_LOAD_PATH" ":" prefix + (,modules)) + `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,go))) + #t)))))) + (native-inputs `(("pkg-config" ,pkg-config) + ("tzdata" ,tzdata-for-tests))) + (inputs `(("ed" ,ed) ("which" ,which) ("guile" ,guile-2.2))) (home-page "https://www.gnu.org/software/mcron/") (synopsis "Run jobs at scheduled times") (description @@ -684,67 +717,8 @@ format is also supported.") (license license:gpl3+))) (define-public mcron2 - ;; This is mthl's mcron development branch, not yet merged in mcron. - (let ((commit "31baff1a5187d8ddc89324cbe42dbeffc309c962")) - (package - (inherit mcron) - (name "mcron2") - (version (string-append (package-version mcron) "-0." - (string-take commit 7))) - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://notabug.org/mthl/mcron/") - (commit commit))) - (sha256 - (base32 - "1h5wxy997hxi718hpx419c23q09939kbxrjbbq54lv0cgw1bb63z")) - (file-name (string-append name "-" version "-checkout")))) - (native-inputs - `(("autoconf" ,autoconf) - ("automake" ,automake) - ("pkg-config" ,pkg-config) - ("texinfo" ,texinfo) - ("help2man" ,help2man))) - (inputs - `(("guile-2.2" ,guile-2.2) - ,@(srfi-1:alist-delete "guile" (package-inputs mcron)))) - (arguments - `(#:modules ((ice-9 match) (ice-9 ftw) - ,@%gnu-build-system-modules) - ;; When building the targets in parallel, help2man tries to generate - ;; the manpage from ./cron --help before it is built, which fails. - #:parallel-build? #f - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'use-guile-2.2 - (lambda _ - (substitute* "configure.ac" - (("PKG_CHECK_MODULES\\(\\[GUILE\\],.*$") - "PKG_CHECK_MODULES([GUILE], [guile-2.2])\n") - (("guile/site/2.0") - "guile/site/2.2")) - #t)) - (add-after 'use-guile-2.2 'bootstrap - (lambda _ - (invoke "autoreconf" "-vfi"))) - (add-after 'install 'wrap-mcron - (lambda* (#:key outputs #:allow-other-keys) - ;; Wrap the 'mcron' command to refer to the right - ;; modules. - (let* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (site (string-append - out "/share/guile/site"))) - (match (scandir site) - (("." ".." version) - (let ((modules (string-append site "/" version))) - (wrap-program (string-append bin "/mcron") - `("GUILE_LOAD_PATH" ":" prefix - (,modules)) - `("GUILE_LOAD_COMPILED_PATH" ":" prefix - (,modules))) - #t)))))))))))) + ;; This was mthl's mcron development branch, and it became mcron 1.1. + (deprecated-package "mcron2" mcron)) (define-public guile-ics (package diff --git a/gnu/services/mcron.scm b/gnu/services/mcron.scm index b6cb8bc726..5bee02a587 100644 --- a/gnu/services/mcron.scm +++ b/gnu/services/mcron.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016, 2017 Ludovic Courtès +;;; Copyright © 2016, 2017, 2018 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -20,7 +20,7 @@ #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu services shepherd) - #:autoload (gnu packages guile) (mcron2) + #:autoload (gnu packages guile) (mcron) #:use-module (guix records) #:use-module (guix gexp) #:use-module (srfi srfi-1) @@ -53,7 +53,7 @@ make-mcron-configuration mcron-configuration? (mcron mcron-configuration-mcron ;package - (default mcron2)) + (default mcron)) (jobs mcron-configuration-jobs ;list of (default '()))) @@ -100,7 +100,7 @@ jobs))))) (default-value (mcron-configuration)))) ;empty job list -(define* (mcron-service jobs #:optional (mcron mcron2)) +(define* (mcron-service jobs #:optional (mcron mcron)) "Return an mcron service running @var{mcron} that schedules @var{jobs}, a list of gexps denoting mcron job specifications. diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 378c7ff021..63d2789cc5 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016, 2017 Ludovic Courtès +;;; Copyright © 2016, 2017, 2018 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -477,7 +477,7 @@ in a loop. See .") (define %mcron-os ;; System with an mcron service, with one mcron job for "root" and one mcron - ;; job for an unprivileged user (note: #:user is an 'mcron2' thing.) + ;; job for an unprivileged user. (let ((job1 #~(job next-second-from (lambda () (call-with-output-file "witness" -- cgit v1.2.3