diff options
-rw-r--r-- | gnu/services/virtualization.scm | 35 | ||||
-rw-r--r-- | gnu/tests/base.scm | 14 | ||||
-rw-r--r-- | gnu/tests/install.scm | 35 | ||||
-rw-r--r-- | gnu/tests/nfs.scm | 31 | ||||
-rw-r--r-- | gnu/tests/reconfigure.scm | 15 |
5 files changed, 63 insertions, 67 deletions
diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm index 88cc91bb49..796b9bf86f 100644 --- a/gnu/services/virtualization.scm +++ b/gnu/services/virtualization.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Ryan Moe <[email protected]> -;;; Copyright © 2018, 2020-2024 Ludovic Courtès <[email protected]> +;;; Copyright © 2018, 2020-2025 Ludovic Courtès <[email protected]> ;;; Copyright © 2020, 2021, 2023, 2024 Janneke Nieuwenhuizen <[email protected]> ;;; Copyright © 2021 Timotej Lazar <[email protected]> ;;; Copyright © 2022 Oleg Pykhalov <[email protected]> @@ -1289,17 +1289,20 @@ that will be listening to receive secret keys on ADDRESS." (_ #f)) (virtual-build-machine-port-forwardings config))) -(define %minimal-vm-syslog-config - ;; Minimal syslog configuration for a VM. - (plain-file "vm-syslog.conf" "\ -# Log most messages to the console, which goes to the serial -# output, allowing the host to log it. -*.info;auth.notice;authpriv.none -/dev/console - -# The rest. -*.=debug -/var/log/debug -authpriv.*;auth.info /var/log/secure -")) +(define %system-log-message-destination + ;; Shepherd system log message destination procedure. Log most messages to + ;; the console, which goes to the serial output, allowing the host to log + ;; it. + #~(lambda (message) + (cond ((= (system-log-priority debug) + (system-log-message-priority message)) + '("/var/log/debug")) + ((member (system-log-message-facility message) + (list (system-log-facility authorization) + (system-log-facility authorization/private))) + '("/var/log/secure")) + (else + '("/dev/console"))))) (define %virtual-build-machine-operating-system (operating-system @@ -1349,10 +1352,10 @@ authpriv.*;auth.info /var/log/secure (inherit config) (authorize-key? #f) (use-substitutes? #f))) - (syslog-service-type config => - (syslog-configuration - (config-file - %minimal-vm-syslog-config))) + (shepherd-system-log-service-type + config => + (system-log-configuration + (message-destination %system-log-message-destination))) (delete mingetty-service-type) (delete console-font-service-type)))))) diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index d9e30e9b1d..223a27be1f 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -984,14 +984,12 @@ non-ASCII names from /tmp.") (inherit config) (debug-level 3) (log-file "/dev/console"))) - (syslog-service-type config - => - (syslog-configuration - (inherit config) - (config-file - (plain-file - "syslog.conf" - "*.* /dev/console\n"))))))))) + (shepherd-system-log-service-type + config + => + (system-log-configuration + (inherit config) + (message-destination #~(const '("/dev/console")))))))))) (define (run-nss-mdns-test) ;; Test resolution of '.local' names via libc. Start the marionette service diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index b799a6752e..a837637b18 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016-2023 Ludovic Courtès <[email protected]> +;;; Copyright © 2016-2023, 2025 Ludovic Courtès <[email protected]> ;;; Copyright © 2017, 2019, 2021 Tobias Geerinckx-Rice <[email protected]> ;;; Copyright © 2020 Mathieu Othacehe <[email protected]> ;;; Copyright © 2020 Danny Milosavljevic <[email protected]> @@ -52,6 +52,7 @@ #:use-module (gnu packages xorg) #:use-module (gnu services desktop) #:use-module (gnu services networking) + #:use-module (gnu services shepherd) #:use-module (gnu services xorg) #:use-module (guix store) #:use-module (guix monads) @@ -1783,27 +1784,25 @@ build (current-guix) and then store a couple of full system images.") ;;; Installation through the graphical interface. ;;; -(define %syslog-conf - ;; Syslog configuration that dumps to /dev/console, so we can see the - ;; installer's messages during the test. - (computed-file "syslog.conf" - #~(begin - (copy-file #$%default-syslog.conf #$output) - (chmod #$output #o644) - (let ((port (open-file #$output "a"))) - (display "\n*.info /dev/console\n" port) - #t)))) - (define (operating-system-with-console-syslog os) "Return OS with a syslog service that writes to /dev/console." (operating-system (inherit os) - (services (modify-services (operating-system-user-services os) - (syslog-service-type config - => - (syslog-configuration - (inherit config) - (config-file %syslog-conf))))))) + (services + (modify-services (operating-system-user-services os) + (shepherd-system-log-service-type + config + => + (system-log-configuration + (inherit config) + (message-destination + #~(lambda (message) + (let ((destinations ((default-message-destination-procedure) + message))) + (if (<= (system-log-message-priority message) + (system-log-priority info)) + (cons "/dev/console" destinations) + destinations)))))))))) (define %root-password "foo") diff --git a/gnu/tests/nfs.scm b/gnu/tests/nfs.scm index 0d9972e0e9..c08f7186a2 100644 --- a/gnu/tests/nfs.scm +++ b/gnu/tests/nfs.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016, 2017, 2020, 2021 Ludovic Courtès <[email protected]> +;;; Copyright © 2016-2017, 2020-2021, 2025 Ludovic Courtès <[email protected]> ;;; Copyright © 2016 John Darrington <[email protected]> ;;; Copyright © 2017 Mathieu Othacehe <[email protected]> ;;; Copyright © 2017 Tobias Geerinckx-Rice <[email protected]> @@ -33,6 +33,7 @@ #:use-module (gnu services base) #:use-module (gnu services nfs) #:use-module (gnu services networking) + #:use-module (gnu services shepherd) #:use-module (gnu packages admin) #:use-module (gnu packages onc-rpc) #:use-module (gnu packages nfs) @@ -170,14 +171,12 @@ (services ;; Enable debugging output. (modify-services (operating-system-user-services os) - (syslog-service-type config - => - (syslog-configuration - (inherit config) - (config-file - (plain-file - "syslog.conf" - "*.* /dev/console\n"))))))))) + (shepherd-system-log-service-type + config + => + (system-log-configuration + (inherit config) + (message-destination #~(const '("/dev/console")))))))))) (define (run-nfs-server-test) "Run a test of an OS running a service of NFS-SERVICE-TYPE." @@ -287,14 +286,12 @@ directories can be mounted.") "*(rw,insecure,no_subtree_check,\ crossmnt,fsid=root,no_root_squash,insecure,async)"))))) (modify-services (operating-system-user-services os) - (syslog-service-type config - => - (syslog-configuration - (inherit config) - (config-file - (plain-file - "syslog.conf" - "*.* /dev/console\n")))))))) + (shepherd-system-log-service-type + config + => + (system-log-configuration + (inherit config) + (message-destination #~(const '("/dev/console"))))))))) #:requirements '(nscd) #:imported-modules '((gnu services herd) (guix combinators))))) diff --git a/gnu/tests/reconfigure.scm b/gnu/tests/reconfigure.scm index a24a953e6e..77cbe16a9c 100644 --- a/gnu/tests/reconfigure.scm +++ b/gnu/tests/reconfigure.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019 Jakob L. Kreuze <[email protected]> -;;; Copyright © 2024 Ludovic Courtès <[email protected]> +;;; Copyright © 2024-2025 Ludovic Courtès <[email protected]> ;;; ;;; This file is part of GNU Guix. ;;; @@ -190,13 +190,12 @@ Shepherd (PID 1) by unloading obsolete services and loading new services." (operating-system (inherit %simple-os) (services (modify-services %base-services - (syslog-service-type - config => (syslog-configuration - (inherit config) - (config-file - (plain-file - "syslog.conf" - "*.* /dev/console\n"))))))) + (shepherd-system-log-service-type + config + => + (system-log-configuration + (inherit config) + (message-destination #~(const '("/dev/console")))))))) #:imported-modules '((gnu services herd) (guix combinators)))) |