From 99190575a0a37115a11e561ae8a9bbdb5398dfd8 Mon Sep 17 00:00:00 2001 From: Florian Pelz Date: Fri, 18 Oct 2019 08:52:12 +0200 Subject: Fix documentation of delete_after in the getmail service. * doc/guix.texi (Getmail service): Remove the word `not'. * gnu/services/getmail.scm (getmail-options-configuration): Ditto. --- gnu/services/getmail.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/getmail.scm b/gnu/services/getmail.scm index b807bb3a5d..b3d86cb65c 100644 --- a/gnu/services/getmail.scm +++ b/gnu/services/getmail.scm @@ -176,8 +176,8 @@ server.") (delete-after (non-negative-integer 0) "Getmail will delete messages this number of days after seeing them, if -they have not been delivered. This means messages will be left on the server -this number of days after delivering them. A value of @samp{0} disabled this +they have been delivered. This means messages will be left on the server this +number of days after delivering them. A value of @samp{0} disabled this feature.") (delete-bigger-than (non-negative-integer 0) -- cgit v1.2.3 From 6aeae5b90b9513d316141c0131fd43c76a200f63 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 18 Oct 2019 22:37:20 +0200 Subject: herd: Define 'shepherd-message-port'. * gnu/services/herd.scm (shepherd-message-port): New variable. (display-message): Use it instead of 'current-error-port'. --- gnu/services/herd.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/herd.scm b/gnu/services/herd.scm index 2207b2d34b..112a7dc104 100644 --- a/gnu/services/herd.scm +++ b/gnu/services/herd.scm @@ -25,6 +25,7 @@ #:use-module (srfi srfi-35) #:use-module (ice-9 match) #:export (%shepherd-socket-file + shepherd-message-port shepherd-error? service-not-found-error? @@ -140,8 +141,12 @@ does not denote an error." (#f ;not an error #t))) +(define shepherd-message-port + ;; Port where messages coming from shepherd are printed. + (make-parameter (current-error-port))) + (define (display-message message) - (format (current-error-port) "shepherd: ~a~%" message)) + (format (shepherd-message-port) "shepherd: ~a~%" message)) (define* (invoke-action service action arguments cont) "Invoke ACTION on SERVICE with ARGUMENTS. On success, call CONT with the -- cgit v1.2.3 From 4e37cf35c0dc2c5be192f9a9455bfe4f23599e57 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 18 Oct 2019 22:50:17 +0200 Subject: services: network-manager: Export 'network-manager-configuration-vpn-plugins'. * gnu/services/networking.scm (): Export 'network-manager-configuration-vpn-plugins'. --- gnu/services/networking.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index dd63009116..f3925615bf 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -110,6 +110,7 @@ network-manager-configuration network-manager-configuration? network-manager-configuration-dns + network-manager-configuration-vpn-plugins network-manager-service-type connman-configuration @@ -986,7 +987,7 @@ and @command{wicd-curses} user interfaces." (default network-manager)) (dns network-manager-configuration-dns (default "default")) - (vpn-plugins network-manager-vpn-plugins ;list of + (vpn-plugins network-manager-configuration-vpn-plugins ;list of (default '()))) (define network-manager-activation -- cgit v1.2.3 From e52b953434b255f53e61125c7fd3653adcebdab8 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 18 Oct 2019 23:12:35 +0200 Subject: services: network-manager: Create account for 'network-manager-openconnect'. Previously, on startup, we'd see: dbus: Unknown username nm-openconnect in message bus configuration file This fixes it. * gnu/services/networking.scm (network-manager-accounts): New procedure. (network-manager-service-type): Extend 'account-service-type'. * gnu/packages/gnome.scm (network-manager-openconnect)[properties]: Add 'user-accounts'. --- gnu/packages/gnome.scm | 7 ++++++- gnu/services/networking.scm | 30 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index f17bd941cd..fafb93be08 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -5635,7 +5635,12 @@ Compatible with Cisco VPN concentrators configured to use IPsec.") to @acronym{VPNs, virtual private networks} via OpenConnect, an open client for Cisco's AnyConnect SSL VPN.") (license license:gpl2+) - (properties `((upstream-name . "NetworkManager-openconnect"))))) + (properties `((upstream-name . "NetworkManager-openconnect") + + ;; The 'etc/dbus-1/system.d/nm-openconnect-service.conf' + ;; file refers to account "nm-openconnect". Specify it here + ;; so that 'network-manager-service-type' creates it. + (user-accounts . ("nm-openconnect")))))) (define-public mobile-broadband-provider-info (package diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index f3925615bf..93d9b6a15e 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -51,6 +51,7 @@ #:use-module (guix gexp) #:use-module (guix records) #:use-module (guix modules) + #:use-module (guix packages) #:use-module (guix deprecation) #:use-module (rnrs enums) #:use-module (srfi srfi-1) @@ -1006,6 +1007,33 @@ and @command{wicd-curses} user interfaces." "Return a directory containing PLUGINS, the NM VPN plugins." (directory-union "network-manager-vpn-plugins" plugins)) +(define (network-manager-accounts config) + "Return the list of and for CONFIG." + (define nologin + (file-append shadow "/sbin/nologin")) + + (define accounts + (append-map (lambda (package) + (map (lambda (name) + (user-account (system? #t) + (name name) + (group "network-manager") + (comment "NetworkManager helper") + (home-directory "/var/empty") + (create-home-directory? #f) + (shell nologin))) + (or (assoc-ref (package-properties package) + 'user-accounts) + '()))) + (network-manager-configuration-vpn-plugins config))) + + (match accounts + (() + '()) + (_ + (cons (user-group (name "network-manager") (system? #t)) + accounts)))) + (define network-manager-environment (match-lambda (($ network-manager dns vpn-plugins) @@ -1055,6 +1083,8 @@ and @command{wicd-curses} user interfaces." (compose list network-manager-configuration-network-manager)) + (service-extension account-service-type + network-manager-accounts) (service-extension activation-service-type network-manager-activation) (service-extension session-environment-service-type -- cgit v1.2.3 From 849af4ae1ba6d4d0b3da3d47fc29ce33b532e4da Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 15 Oct 2019 05:17:54 -0700 Subject: services: xfce: Add xfce4-power-manager to polkit settings. * gnu/services/desktop.scm (xfce-desktop-service-type): Add xfce4-power-manager to polkit-service-type service extension via new procedure 'xfce-polkit-settings'. Signed-off-by: Danny Milosavljevic --- gnu/services/desktop.scm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index a32756e040..5a7f8be4bb 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2017, 2019 Christopher Baines ;;; Copyright © 2019 Tim Gesthuizen +;;; Copyright © 2019 David Wilson ;;; ;;; This file is part of GNU Guix. ;;; @@ -907,15 +908,21 @@ and extends polkit with the actions from @code{mate-settings-daemon}." xfce-desktop-configuration (xfce xfce-package (default xfce))) +(define (xfce-polkit-settings config) + "Return the list of XFCE dependencies that provide polkit actions and +rules." + (let ((xfce (xfce-package config))) + (map (lambda (name) + ((package-direct-input-selector name) xfce)) + '("thunar" + "xfce4-power-manager")))) + (define xfce-desktop-service-type (service-type (name 'xfce-desktop) (extensions (list (service-extension polkit-service-type - (compose list - (package-direct-input-selector - "thunar") - xfce-package)) + xfce-polkit-settings) (service-extension profile-service-type (compose list xfce-package)))) (default-value (xfce-desktop-configuration)) -- cgit v1.2.3 From 5ac5f2c1298cac811a544e2db193ba5d69d9fce6 Mon Sep 17 00:00:00 2001 From: Brendan Tildesley Date: Sun, 20 Oct 2019 23:12:02 +0900 Subject: services: sddm: Add default configuration. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unlike gdm-service-type, sddm-service-type cannot be configured in an operating-system configuration by simply adding (service sddm-service-type). This adds the default SDDM configuration just like GDM does.. * gnu/services/sddm.scm (sddm-service-type)[default-value]: New field. Signed-off-by: Ludovic Courtès --- gnu/services/sddm.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/sddm.scm b/gnu/services/sddm.scm index b0e6d40260..f33f1f93b9 100644 --- a/gnu/services/sddm.scm +++ b/gnu/services/sddm.scm @@ -316,7 +316,8 @@ Relogin=" (if (sddm-configuration-relogin? config) (service-extension account-service-type (const %sddm-accounts)) (service-extension profile-service-type - sddm-profile-service))))) + sddm-profile-service))) + (default-value (sddm-configuration)))) (define* (sddm-service #:optional (config (sddm-configuration))) "Run the @uref{https://github.com/sddm/sddm,SSDM display manager} -- cgit v1.2.3 From 8cf3e167c15a0dba3166cbeee46d41f26cbf75f1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 21 Oct 2019 15:47:55 +0200 Subject: services: sddm: Deprecate 'sddm-service' procedure. * gnu/services/sddm.scm (sddm-service): Mark as deprecated. * doc/guix.texi (X Window): Document 'sddm-service-type' and 'sddm-configuration'. --- doc/guix.texi | 45 ++++++++++++++++++++++++++++++++++++--------- gnu/services/sddm.scm | 4 +++- 2 files changed, 39 insertions(+), 10 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 6eccbb971f..15b6ff04c3 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -14193,16 +14193,43 @@ Relogin after logout. @cindex login manager @cindex X11 login -@deffn {Scheme Procedure} sddm-service config -Return a service that spawns the SDDM graphical login manager for config of -type @code{}. +@defvr {Scheme Variable} sddm-service-type +This is the type of the service to run the +@uref{https://github.com/sddm/sddm,SSDM display manager}. Its value +must be a @code{sddm-configuration} record (see below). -@example - (sddm-service (sddm-configuration - (auto-login-user "Alice") - (auto-login-session "xfce.desktop"))) -@end example -@end deffn +Here's an example use: + +@lisp +(service sddm-service-type + (sddm-configuration + (auto-login-user "alice") + (auto-login-session "xfce.desktop"))) +@end lisp +@end defvr + +@deftp {Data Type} sddm-configuration +This data type represents the configuration of the SDDM login manager. +The available fields are: + +@table @asis +@item @code{sddm} (default: @code{sddm}) +The SDDM package to use. + +@item @code{display-server} (default: @code{"x11"}) +This must be either @code{"x11"} or @code{"wayland"}. + +@c FIXME: Add more fields. + +@item @code{auto-login-user} (default: @code{""}) +If non-empty, this is the user account under which to log in +automatically. + +@item @code{auto-login-session} (default: @code{""}) +If non-empty, this is the @file{.desktop} file name to use as the +auto-login session. +@end table +@end deftp @cindex Xorg, configuration @deftp {Data Type} xorg-configuration diff --git a/gnu/services/sddm.scm b/gnu/services/sddm.scm index f33f1f93b9..c89c0c68bc 100644 --- a/gnu/services/sddm.scm +++ b/gnu/services/sddm.scm @@ -30,6 +30,7 @@ #:use-module (gnu system shadow) #:use-module (guix gexp) #:use-module (guix records) + #:use-module (guix deprecation) #:export (sddm-configuration sddm-configuration? sddm-service-type @@ -319,7 +320,8 @@ Relogin=" (if (sddm-configuration-relogin? config) sddm-profile-service))) (default-value (sddm-configuration)))) -(define* (sddm-service #:optional (config (sddm-configuration))) +(define-deprecated (sddm-service #:optional (config (sddm-configuration))) + sddm-service-type "Run the @uref{https://github.com/sddm/sddm,SSDM display manager} with the given @var{config}, a @code{} object." (service sddm-service-type config)) -- cgit v1.2.3 From cfe8d8063b5d79fc91eb757c2020244e239b77b3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 21 Oct 2019 15:58:48 +0200 Subject: services: sddm: Add description. * gnu/services/sddm.scm (sddm-service-type)[description]: New field. --- gnu/services/sddm.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/sddm.scm b/gnu/services/sddm.scm index c89c0c68bc..ac8c9a8403 100644 --- a/gnu/services/sddm.scm +++ b/gnu/services/sddm.scm @@ -318,7 +318,10 @@ Relogin=" (if (sddm-configuration-relogin? config) (const %sddm-accounts)) (service-extension profile-service-type sddm-profile-service))) - (default-value (sddm-configuration)))) + (default-value (sddm-configuration)) + (description + "Run SDDM, a display and log-in manager for X11 and +Wayland."))) (define-deprecated (sddm-service #:optional (config (sddm-configuration))) sddm-service-type -- cgit v1.2.3 From 5f15b422738d09072c866ef17fd6988a3c84a468 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 21 Oct 2019 16:10:33 +0200 Subject: services: agetty: Really import (gnu build linux-boot). This is a followup to commit 62c2217570fb3a3437e8316d3679b7fe13db0884. * gnu/services/base.scm (agetty-shepherd-service)[start]: Wrap un 'with-imported-modules'. This fixes a build error when TTY is true ("no code for module (gnu build linux-boot)"). --- gnu/services/base.scm | 229 +++++++++++++++++++++++++------------------------- 1 file changed, 116 insertions(+), 113 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/base.scm b/gnu/services/base.scm index e75c56828e..b1eff89ecc 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -990,7 +990,6 @@ to use as the tty. This is primarily useful for headless systems." erase-characters kill-characters chdir delay nice extra-options) (list (shepherd-service - (modules '((ice-9 match) (gnu build linux-boot))) (documentation "Run agetty on a tty.") (provision (list (symbol-append 'term- (string->symbol (or tty "auto"))))) @@ -1000,122 +999,126 @@ to use as the tty. This is primarily useful for headless systems." ;; mingetty-shepherd-service). (requirement '(user-processes host-name udev)) - (start #~(lambda args - (let ((defaulted-tty #$(or tty (default-serial-port)))) - (apply - (if defaulted-tty - (make-forkexec-constructor - (list #$(file-append util-linux "/sbin/agetty") - #$@extra-options - #$@(if eight-bits? - #~("--8bits") - #~()) - #$@(if no-reset? - #~("--noreset") - #~()) - #$@(if remote? - #~("--remote") - #~()) - #$@(if flow-control? - #~("--flow-control") - #~()) - #$@(if host - #~("--host" #$host) - #~()) - #$@(if no-issue? - #~("--noissue") - #~()) - #$@(if init-string - #~("--init-string" #$init-string) - #~()) - #$@(if no-clear? - #~("--noclear") - #~()) + (modules '((ice-9 match) (gnu build linux-boot))) + (start + (with-imported-modules (source-module-closure + '((gnu build linux-boot))) + #~(lambda args + (let ((defaulted-tty #$(or tty (default-serial-port)))) + (apply + (if defaulted-tty + (make-forkexec-constructor + (list #$(file-append util-linux "/sbin/agetty") + #$@extra-options + #$@(if eight-bits? + #~("--8bits") + #~()) + #$@(if no-reset? + #~("--noreset") + #~()) + #$@(if remote? + #~("--remote") + #~()) + #$@(if flow-control? + #~("--flow-control") + #~()) + #$@(if host + #~("--host" #$host) + #~()) + #$@(if no-issue? + #~("--noissue") + #~()) + #$@(if init-string + #~("--init-string" #$init-string) + #~()) + #$@(if no-clear? + #~("--noclear") + #~()) ;;; FIXME This doesn't work as expected. According to agetty(8), if this option ;;; is not passed, then the default is 'auto'. However, in my tests, when that ;;; option is selected, agetty never presents the login prompt, and the ;;; term-ttyS0 service respawns every few seconds. - #$@(if local-line - #~(#$(match local-line - ('auto "--local-line=auto") - ('always "--local-line=always") - ('never "-local-line=never"))) - #~()) - #$@(if tty - #~() - #~("--keep-baud")) - #$@(if extract-baud? - #~("--extract-baud") - #~()) - #$@(if skip-login? - #~("--skip-login") - #~()) - #$@(if no-newline? - #~("--nonewline") - #~()) - #$@(if login-options - #~("--login-options" #$login-options) - #~()) - #$@(if chroot - #~("--chroot" #$chroot) - #~()) - #$@(if hangup? - #~("--hangup") - #~()) - #$@(if keep-baud? - #~("--keep-baud") - #~()) - #$@(if timeout - #~("--timeout" #$(number->string timeout)) - #~()) - #$@(if detect-case? - #~("--detect-case") - #~()) - #$@(if wait-cr? - #~("--wait-cr") - #~()) - #$@(if no-hints? - #~("--nohints?") - #~()) - #$@(if no-hostname? - #~("--nohostname") - #~()) - #$@(if long-hostname? - #~("--long-hostname") - #~()) - #$@(if erase-characters - #~("--erase-chars" #$erase-characters) - #~()) - #$@(if kill-characters - #~("--kill-chars" #$kill-characters) - #~()) - #$@(if chdir - #~("--chdir" #$chdir) - #~()) - #$@(if delay - #~("--delay" #$(number->string delay)) - #~()) - #$@(if nice - #~("--nice" #$(number->string nice)) - #~()) - #$@(if auto-login - (list "--autologin" auto-login) - '()) - #$@(if login-program - #~("--login-program" #$login-program) - #~()) - #$@(if login-pause? - #~("--login-pause") - #~()) - defaulted-tty - #$@(if baud-rate - #~(#$baud-rate) - #~()) - #$@(if term - #~(#$term) - #~()))) - (const #f)) ; never start. - args)))) + #$@(if local-line + #~(#$(match local-line + ('auto "--local-line=auto") + ('always "--local-line=always") + ('never "-local-line=never"))) + #~()) + #$@(if tty + #~() + #~("--keep-baud")) + #$@(if extract-baud? + #~("--extract-baud") + #~()) + #$@(if skip-login? + #~("--skip-login") + #~()) + #$@(if no-newline? + #~("--nonewline") + #~()) + #$@(if login-options + #~("--login-options" #$login-options) + #~()) + #$@(if chroot + #~("--chroot" #$chroot) + #~()) + #$@(if hangup? + #~("--hangup") + #~()) + #$@(if keep-baud? + #~("--keep-baud") + #~()) + #$@(if timeout + #~("--timeout" #$(number->string timeout)) + #~()) + #$@(if detect-case? + #~("--detect-case") + #~()) + #$@(if wait-cr? + #~("--wait-cr") + #~()) + #$@(if no-hints? + #~("--nohints?") + #~()) + #$@(if no-hostname? + #~("--nohostname") + #~()) + #$@(if long-hostname? + #~("--long-hostname") + #~()) + #$@(if erase-characters + #~("--erase-chars" #$erase-characters) + #~()) + #$@(if kill-characters + #~("--kill-chars" #$kill-characters) + #~()) + #$@(if chdir + #~("--chdir" #$chdir) + #~()) + #$@(if delay + #~("--delay" #$(number->string delay)) + #~()) + #$@(if nice + #~("--nice" #$(number->string nice)) + #~()) + #$@(if auto-login + (list "--autologin" auto-login) + '()) + #$@(if login-program + #~("--login-program" #$login-program) + #~()) + #$@(if login-pause? + #~("--login-pause") + #~()) + defaulted-tty + #$@(if baud-rate + #~(#$baud-rate) + #~()) + #$@(if term + #~(#$term) + #~()))) + (const #f)) ; never start. + args))))) (stop #~(make-kill-destructor))))))) (define agetty-service-type -- cgit v1.2.3 From 84261a233ecb58d7a622329d95a8d0d3fc92f886 Mon Sep 17 00:00:00 2001 From: Tim Gesthuizen Date: Thu, 10 Oct 2019 18:38:36 +0200 Subject: services: inputattach: Add 'baud-rate' parameter. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/desktop.scm (inputattach-configuration): Add baud-rate field. (inputattach-shepherd-service): Add baud-rate to parameters when specified. * doc/guix.texi (Miscellaneous Services): [inputattach Service] Document baud-rate parameter. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 4 ++++ gnu/services/desktop.scm | 30 ++++++++++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 15b6ff04c3..b550b1c34a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -24573,6 +24573,10 @@ The type of device to connect to. Run @command{inputattach --help}, from the @item @code{device} (default: @code{"/dev/ttyS0"}) The device file to connect to the device. +@item @code{baud-rate} (default: @code{#f}) +Baud rate to use for the serial connection. +Should be a number or @code{#f}. + @item @code{log-file} (default: @code{#f}) If true, this must be the name of a file to log messages to. @end table diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 5a7f8be4bb..08acb79ed6 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -1028,23 +1028,29 @@ as expected."))) (default "wacom")) (device inputattach-configuration-device (default "/dev/ttyS0")) + (baud-rate inputattach-configuration-baud-rate + (default #f)) (log-file inputattach-configuration-log-file (default #f))) (define inputattach-shepherd-service (match-lambda - (($ type device log-file) - (list (shepherd-service - (provision '(inputattach)) - (requirement '(udev)) - (documentation "inputattach daemon") - (start #~(make-forkexec-constructor - (list (string-append #$inputattach - "/bin/inputattach") - (string-append "--" #$type) - #$device) - #:log-file #$log-file)) - (stop #~(make-kill-destructor))))))) + (($ type device baud-rate log-file) + (let ((args (append (if baud-rate + (list "--baud-rate" (number->string baud-rate)) + '()) + (list (string-append "--" type) + device)))) + (list (shepherd-service + (provision '(inputattach)) + (requirement '(udev)) + (documentation "inputattach daemon") + (start #~(make-forkexec-constructor + (cons (string-append #$inputattach + "/bin/inputattach") + (quote #$args)) + #:log-file #$log-file)) + (stop #~(make-kill-destructor)))))))) (define inputattach-service-type (service-type -- cgit v1.2.3 From 00850bb836e1027edb310f3dc69b897f031e23e0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 22 Oct 2019 17:29:35 +0200 Subject: services: elogind, gnome, mate, xfce: Fix config type predicate identifiers. * gnu/services/desktop.scm (): Add question mark in type predicate identifier. (): Likewise. (): Likewise. (): Likewise. --- gnu/services/desktop.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 08acb79ed6..449b606a31 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -580,7 +580,7 @@ include the @command{udisksctl} command, part of UDisks, and GNOME Disks." (define-record-type* elogind-configuration make-elogind-configuration - elogind-configuration + elogind-configuration? (elogind elogind-package (default elogind)) (kill-user-processes? elogind-kill-user-processes? @@ -834,7 +834,7 @@ accountsservice web site} for more information." (define-record-type* gnome-desktop-configuration make-gnome-desktop-configuration - gnome-desktop-configuration + gnome-desktop-configuration? (gnome-package gnome-package (default gnome))) (define (gnome-polkit-settings config) @@ -872,7 +872,7 @@ and extends polkit with the actions from @code{gnome-settings-daemon}." (define-record-type* mate-desktop-configuration make-mate-desktop-configuration - mate-desktop-configuration + mate-desktop-configuration? (mate-package mate-package (default mate))) (define mate-desktop-service-type @@ -905,7 +905,7 @@ and extends polkit with the actions from @code{mate-settings-daemon}." (define-record-type* xfce-desktop-configuration make-xfce-desktop-configuration - xfce-desktop-configuration + xfce-desktop-configuration? (xfce xfce-package (default xfce))) (define (xfce-polkit-settings config) -- cgit v1.2.3 From b40f4a5995cff00077aa60881737d0d0f6871982 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 23 Oct 2019 21:48:08 +0200 Subject: services: cuirass: Create /var/log/cuirass during activation. * gnu/services/cuirass.scm (cuirass-activation): Create "/var/log/cuirass". --- gnu/services/cuirass.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm index 914a0d337f..d92421762a 100644 --- a/gnu/services/cuirass.scm +++ b/gnu/services/cuirass.scm @@ -164,6 +164,7 @@ (let ((cache (cuirass-configuration-cache-directory config)) (db (dirname (cuirass-configuration-database config))) (user (cuirass-configuration-user config)) + (log "/var/log/cuirass") (group (cuirass-configuration-group config))) (with-imported-modules '((guix build utils)) #~(begin @@ -171,11 +172,13 @@ (mkdir-p #$cache) (mkdir-p #$db) + (mkdir-p #$log) (let ((uid (passwd:uid (getpw #$user))) (gid (group:gid (getgr #$group)))) (chown #$cache uid gid) - (chown #$db uid gid)))))) + (chown #$db uid gid) + (chown #$log uid gid)))))) (define (cuirass-log-rotations config) "Return the list of log rotations that corresponds to CONFIG." -- cgit v1.2.3 From 88f95687c79d33442bcc04062b17bfe946d7d109 Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Wed, 23 Oct 2019 21:57:52 -0400 Subject: services: gdm: Add 'debug?' configuration field. * gnu/services/xorg.scm ()[debug?]: New field. (gdm-configuration-file): Use it. * doc/guix.texi: Document it. --- doc/guix.texi | 3 +++ gnu/services/xorg.scm | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 746561ed97..a934626e5a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -13988,6 +13988,9 @@ When @code{auto-login?} is false, GDM presents a log-in screen. When @code{auto-login?} is true, GDM logs in directly as @code{default-user}. +@item @code{debug?} (default: @code{#f}) +When true, GDM writes debug messages to its log. + @item @code{gnome-shell-assets} (default: ...) List of GNOME Shell assets needed by GDM: icon theme, fonts, etc. diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 1d55e388a1..9c84f7413f 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -835,6 +835,7 @@ the GNOME desktop environment.") (allow-empty-passwords? gdm-configuration-allow-empty-passwords? (default #t)) (auto-login? gdm-configuration-auto-login? (default #f)) (dbus-daemon gdm-configuration-dbus-daemon (default dbus-daemon-wrapper)) + (debug? gdm-configuration-debug? (default #f)) (default-user gdm-configuration-default-user (default #f)) (gnome-shell-assets gdm-configuration-gnome-shell-assets (default (list adwaita-icon-theme font-cantarell))) @@ -866,7 +867,9 @@ the GNOME desktop environment.") "WaylandEnable=false\n" "\n" "[debug]\n" - "#Enable=true\n" + "Enable=" (if (gdm-configuration-debug? config) + "true" + "false") "\n" "\n" "[security]\n" "#DisallowTCP=true\n" -- cgit v1.2.3 From 878e0e1bb0d15809c6582436d53498f3e6385524 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 29 Oct 2019 15:07:25 +0100 Subject: gnu: mpd-service-type: Support configuration of outputs. * gnu/services/audio.scm (): New record type. ()[outputs]: New field. (mpd-output, mpd-output?, mpd-output->string): New procedures. (mpd-config->file): Use mpd-output->string. * doc/guix.texi (Audio Services): Document mpd-output fields. --- doc/guix.texi | 60 +++++++++++++++++++++++++++++++++++ gnu/services/audio.scm | 85 ++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 128 insertions(+), 17 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 7cc33c6e22..f6dcb2ac63 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -22394,9 +22394,69 @@ The port to run mpd on. The address that mpd will bind to. To use a Unix domain socket, an absolute path can be specified here. +@item @code{outputs} (default: @code{"(list (mpd-output))"}) +The audio outputs that MPD can use. By default this is a single output using pulseaudio. + +@end table +@end deftp + +@deftp {Data Type} mpd-output +Data type representing an @command{mpd} audio output. + +@table @asis +@item @code{name} (default: @code{"MPD"}) +The name of the audio output. + +@item @code{type} (default: @code{"pulse"}) +The type of audio output. + +@item @code{enabled?} (default: @code{#t}) +Specifies whether this audio output is enabled when MPD is started. By +default, all audio outputs are enabled. This is just the default +setting when there is no state file; with a state file, the previous +state is restored. + +@item @code{tags?} (default: @code{#t}) +If set to @code{#f}, then MPD will not send tags to this output. This +is only useful for output plugins that can receive tags, for example the +@code{httpd} output plugin. + +@item @code{always-on?} (default: @code{#f}) +If set to @code{#t}, then MPD attempts to keep this audio output always +open. This may be useful for streaming servers, when you don’t want to +disconnect all listeners even when playback is accidentally stopped. + +@item @code{mixer-type} +This field accepts a symbol that specifies which mixer should be used +for this audio output: the @code{hardware} mixer, the @code{software} +mixer, the @code{null} mixer (allows setting the volume, but with no +effect; this can be used as a trick to implement an external mixer +External Mixer) or no mixer (@code{none}). + +@item @code{extra-options} (default: @code{'()"}) +An association list of option symbols to string values to be appended to +the audio output configuration. + @end table @end deftp +The following example shows a configuration of @code{mpd} that provides +an HTTP audio streaming output. + +@lisp +(service mpd-service-type + (mpd-configuration + (outputs + (list (mpd-output + (name "streaming") + (type "httpd") + (mixer-type 'null) + (extra-options + `((encoder . "vorbis") + (port . "8080")))))))) +@end lisp + + @node Virtualization Services @subsection Virtualization services diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm index ebfe05abd0..471c5fd95f 100644 --- a/gnu/services/audio.scm +++ b/gnu/services/audio.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Peter Mikkelsen +;;; Copyright © 2019 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -23,7 +24,9 @@ #:use-module (gnu packages mpd) #:use-module (guix records) #:use-module (ice-9 match) - #:export (mpd-configuration + #:export (mpd-output + mpd-output? + mpd-configuration mpd-configuration? mpd-service-type)) @@ -33,6 +36,25 @@ ;;; ;;; Code: +(define-record-type* + mpd-output make-mpd-output + mpd-output? + (type mpd-output-type + (default "pulse")) + (name mpd-output-name + (default "MPD")) + (enabled? mpd-output-enabled? + (default #t)) + (tags? mpd-output-tags? + (default #t)) + (always-on? mpd-output-always-on? + (default #f)) + (mixer-type mpd-output-mixer-type + ;; valid: hardware, software, null, none + (default #f)) + (extra-options mpd-output-extra-options + (default '()))) + (define-record-type* mpd-configuration make-mpd-configuration mpd-configuration? @@ -51,27 +73,56 @@ (port mpd-configuration-port (default "6600")) (address mpd-configuration-address - (default "any"))) + (default "any")) + (outputs mpd-configuration-outputs + (default (list (mpd-output))))) + +(define (mpd-output->string output) + "Convert the OUTPUT of type to a configuration file snippet." + (let ((extra (string-join + (map (match-lambda + ((key . value) + (format #f " ~a \"~a\"" + (string-map + (lambda (c) (if (char=? c #\-) #\_ c)) + (symbol->string key)) + value))) + (mpd-output-extra-options output)) + "\n"))) + (format #f "\ +audio_output { + type \"~a\" + name \"~a\" +~:[ enabled \"no\"~%~;~]\ +~:[ tags \"no\"~%~;~]\ +~:[~; always_on \"yes\"~%~]\ +~@[ mixer_type \"~a\"~%~]\ +~a~%}~%" + (mpd-output-type output) + (mpd-output-name output) + (mpd-output-enabled? output) + (mpd-output-tags? output) + (mpd-output-always-on? output) + (mpd-output-mixer-type output) + extra))) (define (mpd-config->file config) (apply mixed-text-file "mpd.conf" - "audio_output {\n" - " type \"pulse\"\n" - " name \"MPD\"\n" - "}\n" "pid_file \"" (mpd-file-name config "pid") "\"\n" - (map (match-lambda - ((config-name config-val) - (string-append config-name " \"" (config-val config) "\"\n"))) - `(("user" ,mpd-configuration-user) - ("music_directory" ,mpd-configuration-music-dir) - ("playlist_directory" ,mpd-configuration-playlist-dir) - ("db_file" ,mpd-configuration-db-file) - ("state_file" ,mpd-configuration-state-file) - ("sticker_file" ,mpd-configuration-sticker-file) - ("port" ,mpd-configuration-port) - ("bind_to_address" ,mpd-configuration-address))))) + (append (map mpd-output->string + (mpd-configuration-outputs config)) + (map (match-lambda + ((config-name config-val) + (string-append config-name " \"" (config-val config) "\"\n"))) + `(("user" ,mpd-configuration-user) + ("music_directory" ,mpd-configuration-music-dir) + ("playlist_directory" ,mpd-configuration-playlist-dir) + ("db_file" ,mpd-configuration-db-file) + ("state_file" ,mpd-configuration-state-file) + ("sticker_file" ,mpd-configuration-sticker-file) + ("port" ,mpd-configuration-port) + ("bind_to_address" ,mpd-configuration-address)))))) (define (mpd-file-name config file) "Return a path in /var/run/mpd/ that is writable -- cgit v1.2.3 From 97bc3cbea5fc281a299c03eaaa3be5baf21ea673 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 30 Oct 2019 17:46:17 -0400 Subject: services: ntp: Ensure no double quotes are output to config file. * gnu/services/networking.scm (ntp-server->string): Use the textual representation of the values as printed by 'display' rather than 'write', to avoid inserting double quotes in the generated config. * tests/networking.scm (%ntp-server-sample): Add a comment and make one of the options a string, to exercise the fix. ("ntp-server->string"): Move the expected value to the first argument. ("ntp configuration servers deprecated form"): Likewise. ("openntpd generated config string ends with a newline"): Likewise. --- gnu/services/networking.scm | 2 +- tests/networking.scm | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 93d9b6a15e..841fbd741e 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -345,7 +345,7 @@ Protocol (DHCP) client, on all the non-loopback network interfaces." (res '())) (if (list? x) (fold loop res x) - (cons (format #f "~s" x) res))))) + (cons (format #f "~a" x) res))))) (match ntp-server (($ type address options) diff --git a/tests/networking.scm b/tests/networking.scm index 439cca5ffc..c494a48067 100644 --- a/tests/networking.scm +++ b/tests/networking.scm @@ -36,22 +36,23 @@ (ntp-server (type 'server) (address "some.ntp.server.org") - (options `(iburst (version 3) (maxpoll 16) prefer)))) + ;; Using either strings or symbols for option names is accepted. + (options `("iburst" (version 3) (maxpoll 16) prefer)))) (test-equal "ntp-server->string" - (ntp-server->string %ntp-server-sample) - "server some.ntp.server.org iburst version 3 maxpoll 16 prefer") + "server some.ntp.server.org iburst version 3 maxpoll 16 prefer" + (ntp-server->string %ntp-server-sample)) (test-equal "ntp configuration servers deprecated form" + (ntp-configuration-servers + (ntp-configuration + (servers (list "example.pool.ntp.org")))) (ntp-configuration-servers (ntp-configuration (servers (list (ntp-server (type 'server) (address "example.pool.ntp.org") - (options '())))))) - (ntp-configuration-servers - (ntp-configuration - (servers (list "example.pool.ntp.org"))))) + (options '()))))))) ;;; @@ -106,8 +107,8 @@ the sanity check:\n~a~%" config) #t)))) (test-equal "openntpd generated config string ends with a newline" + "\n" (let ((config (openntpd-configuration->string %openntpd-conf-sample))) - (string-take-right config 1)) - "\n") + (string-take-right config 1))) (test-end "networking") -- cgit v1.2.3 From f37ad658eada78384764c7d6db3a7f3ad8ad283e Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Thu, 31 Oct 2019 23:20:22 -0400 Subject: services: ntp: Fix a crash when using legacy configuration. Fixes issue #37504 (see: https://bugs.gnu.org/37504). The bug was caused by the fact that destructuring an record using match would bind the 'servers' field without using the compatibility accessor. * gnu/services/networking.scm (ntp-shepherd-service): Replace `match-lambda' by distinct `lambda' and `match' calls, so that the 'servers' field can be generated by applying the `ntp-configuration-servers' procedure to the configuration object. --- gnu/services/networking.scm | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 841fbd741e..a1c1aad9f6 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -394,15 +394,16 @@ deprecated. Please use records instead.\n") ntp-servers)))) (define ntp-shepherd-service - (match-lambda - (($ ntp servers allow-large-adjustment?) - (let () - ;; TODO: Add authentication support. - (define config - (string-append "driftfile /var/run/ntpd/ntp.drift\n" - (string-join (map ntp-server->string servers) - "\n") - " + (lambda (config) + (match config + (($ ntp servers allow-large-adjustment?) + (let ((servers (ntp-configuration-servers config))) + ;; TODO: Add authentication support. + (define config + (string-append "driftfile /var/run/ntpd/ntp.drift\n" + (string-join (map ntp-server->string servers) + "\n") + " # Disable status queries as a workaround for CVE-2013-5211: # . restrict default kod nomodify notrap nopeer noquery limited @@ -416,20 +417,20 @@ restrict -6 ::1 # option by default, as documented in the 'ntp.conf' manual. restrict source notrap nomodify noquery\n")) - (define ntpd.conf - (plain-file "ntpd.conf" config)) + (define ntpd.conf + (plain-file "ntpd.conf" config)) - (list (shepherd-service - (provision '(ntpd)) - (documentation "Run the Network Time Protocol (NTP) daemon.") - (requirement '(user-processes networking)) - (start #~(make-forkexec-constructor - (list (string-append #$ntp "/bin/ntpd") "-n" - "-c" #$ntpd.conf "-u" "ntpd" - #$@(if allow-large-adjustment? - '("-g") - '())))) - (stop #~(make-kill-destructor)))))))) + (list (shepherd-service + (provision '(ntpd)) + (documentation "Run the Network Time Protocol (NTP) daemon.") + (requirement '(user-processes networking)) + (start #~(make-forkexec-constructor + (list (string-append #$ntp "/bin/ntpd") "-n" + "-c" #$ntpd.conf "-u" "ntpd" + #$@(if allow-large-adjustment? + '("-g") + '())))) + (stop #~(make-kill-destructor))))))))) (define %ntp-accounts (list (user-account -- cgit v1.2.3 From 5afa23e1805e68a7cd9adb2145094dcd29bf67d6 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 29 Oct 2019 23:26:37 +0100 Subject: services: colord: Deprecate 'colord-service' procedure. * gnu/services/desktop.scm (colord-service-type)[default-value]: New field. (colord-service): Define with 'define-deprecated'. (%desktop-services): Use 'colord-service-type' instead of 'colord-service'. * doc/guix.texi (Desktop Services): Adjust accordingly. --- doc/guix.texi | 5 +++-- gnu/services/desktop.scm | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index f6dcb2ac63..7b1ee163c4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -15530,8 +15530,9 @@ notifications and ways to mount/unmount disks. Programs that talk to UDisks include the @command{udisksctl} command, part of UDisks, and GNOME Disks. @end deffn -@deffn {Scheme Procedure} colord-service [#:colord @var{colord}] -Return a service that runs @command{colord}, a system service with a D-Bus +@deffn {Scheme Variable} colord-service-type +This is the type of the service that runs @command{colord}, a system +service with a D-Bus interface to manage the color profiles of input and output devices such as screens and scanners. It is notably used by the GNOME Color Manager graphical tool. See @uref{https://www.freedesktop.org/software/colord/, the colord web diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 449b606a31..0152e86e8a 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -514,12 +514,14 @@ Users need to be in the @code{lp} group to access the D-Bus service. ;; It provides polkit "actions". (service-extension polkit-service-type list))) + (default-value colord) (description "Run @command{colord}, a system service with a D-Bus interface to manage the color profiles of input and output devices such as screens and scanners."))) -(define* (colord-service #:key (colord colord)) +(define-deprecated (colord-service #:key (colord colord)) + colord-service-type "Return a service that runs @command{colord}, a system service with a D-Bus interface to manage the color profiles of input and output devices such as screens and scanners. It is notably used by the GNOME Color Manager graphical @@ -1094,7 +1096,7 @@ dispatches events from it."))) (service upower-service-type) (accountsservice-service) (service cups-pk-helper-service-type) - (colord-service) + (service colord-service-type) (geoclue-service) (service polkit-service-type) (elogind-service) -- cgit v1.2.3 From 33f9778bc83086837b99e5c5e99cd514cb0d154e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 1 Nov 2019 23:29:06 +0100 Subject: services: dbus: Include each service's "share/dbus-1/system.d". Fixes . Reported by Jack Hill . Sometime between 1.1.8 and 1.4.3, 'colord' moved had its 'org.freedesktop.ColorManager.conf' file moved from "etc/dbus-1/system.d" to "share/dbus-1/system.d". Adjust to this change. * gnu/services/dbus.scm (dbus-configuration-directory): Add an 'includedir' directive for DIR/share/dbus-1/system.d. --- gnu/services/dbus.scm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gnu/services') diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index 35d7ff3c9c..fcdeb3bf60 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -100,6 +100,8 @@ includes the @code{etc/dbus-1/system.d} directories of each package listed in ,@(append-map (lambda (dir) `((includedir ,(string-append dir "/etc/dbus-1/system.d")) + (includedir + ,(string-append dir "/share/dbus-1/system.d")) (servicedir ;for '.service' files ,(string-append dir "/share/dbus-1/services")))) services))) -- cgit v1.2.3 From 27727b18b8597f7c6fd99adc7797c555aa1c92e9 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 1 Nov 2019 23:48:40 +0100 Subject: services: dbus: Remove non-existent directories from 'system-local.conf'. This typically halves the number of entries in /etc/dbus-1/system-local.conf. * gnu/services/dbus.scm (dbus-configuration-directory)[build](directives): New macro. (services->sxml): Use it. --- gnu/services/dbus.scm | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index fcdeb3bf60..a697a8820e 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -86,6 +86,19 @@ includes the @code{etc/dbus-1/system.d} directories of each package listed in (use-modules (sxml simple) (srfi srfi-1)) + (define-syntax directives + (syntax-rules () + ;; Expand the given directives (SXML expressions) only if their + ;; key names a file that exists. + ((_ (name directory) rest ...) + (let ((dir directory)) + (if (file-exists? dir) + `((name ,dir) + ,@(directives rest ...)) + (directives rest ...)))) + ((_) + '()))) + (define (services->sxml services) ;; Return the SXML 'includedir' clauses for DIRS. `(busconfig @@ -98,12 +111,13 @@ includes the @code{etc/dbus-1/system.d} directories of each package listed in (servicedir "/etc/dbus-1/system-services") ,@(append-map (lambda (dir) - `((includedir - ,(string-append dir "/etc/dbus-1/system.d")) - (includedir - ,(string-append dir "/share/dbus-1/system.d")) - (servicedir ;for '.service' files - ,(string-append dir "/share/dbus-1/services")))) + (directives + (includedir + (string-append dir "/etc/dbus-1/system.d")) + (includedir + (string-append dir "/share/dbus-1/system.d")) + (servicedir ;for '.service' files + (string-append dir "/share/dbus-1/services")))) services))) (mkdir #$output) -- cgit v1.2.3 From 13f0414ece4b2d6d12b32069df56cde40470f735 Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Sun, 3 Nov 2019 11:51:06 +0300 Subject: gnu: zabbix-agentd: Update to 4.4.1. * gnu/packages/monitoring.scm (zabbix-agentd): Update to 4.4.1. * gnu/services/monitoring.scm (%zabbix-front-end-configuration-nginx): Add listen record field. --- gnu/packages/monitoring.scm | 4 ++-- gnu/services/monitoring.scm | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'gnu/services') diff --git a/gnu/packages/monitoring.scm b/gnu/packages/monitoring.scm index b165e6952d..78f94bbe4b 100644 --- a/gnu/packages/monitoring.scm +++ b/gnu/packages/monitoring.scm @@ -152,7 +152,7 @@ etc. via a Web interface. Features include: (define-public zabbix-agentd (package (name "zabbix-agentd") - (version "4.2.7") + (version "4.4.1") (source (origin (method url-fetch) @@ -161,7 +161,7 @@ etc. via a Web interface. Features include: "/zabbix-" version ".tar.gz")) (sha256 (base32 - "09znh8x1sass5mw6wjrfmizjbfls8ad2c16y24ldfj40hlfxz6wx")))) + "0jjn2przn9s25slrcxmq8iqdgqkgxnqs45zy0n1ma6nlgmclxxqb")))) (build-system gnu-build-system) (arguments `(#:configure-flags diff --git a/gnu/services/monitoring.scm b/gnu/services/monitoring.scm index 7276f7056d..511f4fb2fe 100644 --- a/gnu/services/monitoring.scm +++ b/gnu/services/monitoring.scm @@ -473,7 +473,8 @@ configuration file.")) (list " fastcgi_param PHP_VALUE \"post_max_size = 16M max_execution_time = 300\"; -"))))))))) +"))))))) + (listen '("80")))) (define-configuration zabbix-front-end-configuration ;; TODO: Specify zabbix front-end package. -- cgit v1.2.3 From 548efa8bdfa440e95c2928c434b72b0411ed31ba Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 5 Nov 2019 14:51:57 +0200 Subject: services: patchwork: Fix typo. * gnu/services.web.scm (define-gexp-compiler): Use 'enable-rest-api?' where appropriate in place of 'enable-xmlrpc?' --- gnu/services/web.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 899be1c168..9320da5b17 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -1425,7 +1425,7 @@ ADMINS = [ DEBUG = " #$(if debug? "True" "False") " -ENABLE_REST_API = " #$(if enable-xmlrpc? "True" "False") " +ENABLE_REST_API = " #$(if enable-rest-api? "True" "False") " ENABLE_XMLRPC = " #$(if enable-xmlrpc? "True" "False") " FORCE_HTTPS_LINKS = " #$(if force-https-links? "True" "False") " -- cgit v1.2.3 From 2dfb9ba4069aa9d9a39935ef43cc09fabe9dbe4d Mon Sep 17 00:00:00 2001 From: Miguel Ángel Arruga Vivas Date: Sun, 27 Oct 2019 03:59:23 +0100 Subject: services: libvirtd: Provide ip binary at runtime. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/virtualization.scm (libvirt-shepherd-service): Add sbin to the PATH variable, as ip binary is installed there. Signed-off-by: Ludovic Courtès --- gnu/services/virtualization.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm index bc8ac9b40a..2cd4e5e89c 100644 --- a/gnu/services/virtualization.scm +++ b/gnu/services/virtualization.scm @@ -433,9 +433,11 @@ potential infinite waits blocking libvirt.")) (start #~(make-forkexec-constructor (list (string-append #$libvirt "/sbin/libvirtd") "-f" #$config-file) + ;; For finding qemu and ip binaries. #:environment-variables - ;; For finding qemu binaries. - '("PATH=/run/current-system/profile/bin"))) + (list (string-append + "PATH=/run/current-system/profile/bin:" + "/run/current-system/profile/sbin")))) (stop #~(make-kill-destructor)))))) (define libvirt-service-type -- cgit v1.2.3 From 00e680a411652e30d18839fa9ec86cf4068164de Mon Sep 17 00:00:00 2001 From: Florian Pelz Date: Wed, 6 Nov 2019 19:15:57 +0100 Subject: services: Make it possible to include dynamic modules in nginx. * gnu/services/web.scm (): Add modules field. (nginx-configuration-modules): New field accessor. (emit-load-module): New procedure. (default-nginx-config): Add support for the modules field. * doc/guix.texi (NGINX): Document it. --- doc/guix.texi | 11 +++++++++++ gnu/services/web.scm | 8 ++++++++ 2 files changed, 19 insertions(+) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 3b8e5935bb..4df928e400 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19765,6 +19765,17 @@ use the size of the processors cache line. @item @code{server-names-hash-bucket-max-size} (default: @code{#f}) Maximum bucket size for the server names hash tables. +@item @code{modules} (default: @code{'()}) +List of nginx dynamic modules to load. This should be a list of file +names of loadable modules, as in this example: + +@lisp +(modules + (list + (file-append nginx-accept-language-module "\ +/etc/nginx/modules/ngx_http_accept_language_module.so"))) +@end lisp + @item @code{extra-content} (default: @code{""}) Extra content for the @code{http} block. Should be string or a string valued G-expression. diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 9320da5b17..f13e86482f 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2018 Pierre-Antoine Rouby ;;; Copyright © 2017, 2018, 2019 Christopher Baines ;;; Copyright © 2018 Marius Bakke +;;; Copyright © 2019 Florian Pelz ;;; ;;; This file is part of GNU Guix. ;;; @@ -95,6 +96,7 @@ nginx-configuration-upstream-blocks nginx-configuration-server-names-hash-bucket-size nginx-configuration-server-names-hash-bucket-max-size + nginx-configuration-modules nginx-configuration-extra-content nginx-configuration-file @@ -522,6 +524,7 @@ (default #f)) (server-names-hash-bucket-max-size nginx-configuration-server-names-hash-bucket-max-size (default #f)) + (modules nginx-configuration-modules (default '())) (extra-content nginx-configuration-extra-content (default "")) (file nginx-configuration-file ;#f | string | file-like @@ -542,6 +545,9 @@ of index files." ((? string? str) (list str " "))) names)) +(define (emit-load-module module) + (list "load_module " module ";\n")) + (define emit-nginx-location-config (match-lambda (($ uri body) @@ -615,12 +621,14 @@ of index files." server-blocks upstream-blocks server-names-hash-bucket-size server-names-hash-bucket-max-size + modules extra-content) (apply mixed-text-file "nginx.conf" (flatten "user nginx nginx;\n" "pid " run-directory "/pid;\n" "error_log " log-directory "/error.log info;\n" + (map emit-load-module modules) "http {\n" " client_body_temp_path " run-directory "/client_body_temp;\n" " proxy_temp_path " run-directory "/proxy_temp;\n" -- cgit v1.2.3 From 970cb5ceceaa85765230a9f896a43783cdcb4e6c Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 5 Nov 2019 23:46:46 +0100 Subject: services: mpd: Connect to the user's PulseAudio socket. * gnu/services/audio.scm (mpd-shepherd-service): Set the XDG_RUNTIME_DIR environment variable. Signed-off-by: Tobias Geerinckx-Rice --- gnu/services/audio.scm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gnu/services') diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm index 471c5fd95f..345d8225b2 100644 --- a/gnu/services/audio.scm +++ b/gnu/services/audio.scm @@ -140,6 +140,13 @@ audio_output { "--no-daemon" #$(mpd-config->file config)) #:pid-file #$(mpd-file-name config "pid") + #:environment-variables + ;; Required to detect PulseAudio when run under a user account. + '(#$(string-append + "XDG_RUNTIME_DIR=/run/user/" + (number->string + (passwd:uid + (getpwnam (mpd-configuration-user config)))))) #:log-file #$(mpd-file-name config "log"))) (stop #~(make-kill-destructor)))) -- cgit v1.2.3 From 1ce0d7e190784c709abf3346d8d94e7e143569dc Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 9 Nov 2019 11:33:12 +0100 Subject: services: hpcguix-web: Explicitly import (guix build utils). * gnu/services/web.scm (%hpcguix-web-activation): Add explicit 'with-imported-modules'. --- gnu/services/web.scm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/web.scm b/gnu/services/web.scm index f13e86482f..d0c9d0df2b 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 David Thompson -;;; Copyright © 2015, 2016, 2017, 2018 Ludovic Courtès +;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2016 ng0 ;;; Copyright © 2016, 2017, 2018 Julien Lepiller ;;; Copyright © 2017 Christopher Baines @@ -1047,13 +1047,15 @@ a webserver.") (shell (file-append shadow "/sbin/nologin"))))) (define %hpcguix-web-activation - #~(begin - (use-modules (guix build utils)) - (let ((home-dir "/var/cache/guix/web") - (user (getpwnam "hpcguix-web"))) - (mkdir-p home-dir) - (chown home-dir (passwd:uid user) (passwd:gid user)) - (chmod home-dir #o755)))) + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + + (let ((home-dir "/var/cache/guix/web") + (user (getpwnam "hpcguix-web"))) + (mkdir-p home-dir) + (chown home-dir (passwd:uid user) (passwd:gid user)) + (chmod home-dir #o755))))) (define %hpcguix-web-log-file "/var/log/hpcguix-web.log") -- cgit v1.2.3 From 7c34c62c807b357b5cdad6fde0f11c9fe93279d0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 9 Nov 2019 15:12:30 +0100 Subject: services: hpcguix-web: Delete lock files during activation. * gnu/services/web.scm (%hpcguix-web-activation): Delete ".lock" files from HOME-DIR. --- gnu/services/web.scm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/web.scm b/gnu/services/web.scm index d0c9d0df2b..3d149a105d 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -1049,13 +1049,22 @@ a webserver.") (define %hpcguix-web-activation (with-imported-modules '((guix build utils)) #~(begin - (use-modules (guix build utils)) + (use-modules (guix build utils) + (ice-9 ftw)) (let ((home-dir "/var/cache/guix/web") (user (getpwnam "hpcguix-web"))) (mkdir-p home-dir) (chown home-dir (passwd:uid user) (passwd:gid user)) - (chmod home-dir #o755))))) + (chmod home-dir #o755) + + ;; Remove stale 'packages.json.lock' file (and other lock files, if + ;; any) since that would prevent 'packages.json' from being updated. + (for-each (lambda (lock) + (delete-file (string-append home-dir "/" lock))) + (scandir home-dir + (lambda (file) + (string-suffix? ".lock" file)))))))) (define %hpcguix-web-log-file "/var/log/hpcguix-web.log") -- cgit v1.2.3 From 6ec68c69b08a873c5896dae9f8f234e44ea45738 Mon Sep 17 00:00:00 2001 From: 宋文武 Date: Sat, 9 Nov 2019 17:05:50 +0800 Subject: services: Add knot-resolver-service-type. * gnu/services/dns.scm (): New record type. (knot-resolver-activation, knot-resolver-shpherd-services): New procedures. (%knot-resolver-accounts, %kresd.conf, knot-resolver-service-type): New variables. * doc/guix.texi (DNS Services): Document it. --- doc/guix.texi | 38 +++++++++++++++++++++++ gnu/services/dns.scm | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index aaad6e376b..2622079bcb 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -21086,6 +21086,44 @@ The list of knot-zone-configuration used by this configuration. @end table @end deftp +@subsubheading Knot Resolver Service + +@deffn {Scheme Variable} knot-resolver-service-type +This this the type of the knot resolver service, whose value should be +an @code{knot-resolver-configuration} object as in this example: + +@lisp +(service knot-resolver-service-type + (knot-resolver-configuration + (kresd-config-file (plain-file "kresd.conf" " +net.listen('192.168.0.1', 5353) +user('knot-resolver', 'knot-resolver') +modules = @{ 'hints > iterate', 'stats', 'predict' @} +cache.size = 100 * MB +")))) +@end lisp + +For more information, refer its @url{https://knot-resolver.readthedocs.org/en/stable/daemon.html#configuration, manual}. +@end deffn + +@deftp {Data Type} knot-resolver-configuration +Data type representing the configuration of knot-resolver. + +@table @asis +@item @code{package} (default: @var{knot-resolver}) +Package object of the knot DNS resolver. + +@item @code{kresd-config-file} (default: %kresd.conf) +File-like object of the kresd configuration file to use, by default it +will listen on @code{127.0.0.1} and @code{::1}. + +@item @code{garbage-collection-interval} (default: 1000) +Number of milliseconds for @code{kres-cache-gc} to periodically trim the cache. + +@end table +@end deftp + + @subsubheading Dnsmasq Service @deffn {Scheme Variable} dnsmasq-service-type diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm index 5f37cb0782..43b6261c07 100644 --- a/gnu/services/dns.scm +++ b/gnu/services/dns.scm @@ -45,6 +45,9 @@ zone-file zone-entry + knot-resolver-service-type + knot-resolver-configuration + dnsmasq-service-type dnsmasq-configuration @@ -637,6 +640,89 @@ (service-extension account-service-type (const %knot-accounts)))))) + +;;; +;;; Knot Resolver. +;;; + +(define-record-type* + knot-resolver-configuration + make-knot-resolver-configuration + knot-resolver-configuration? + (package knot-resolver-configuration-package + (default knot-resolver)) + (kresd-config-file knot-resolver-kresd-config-file + (default %kresd.conf)) + (garbage-collection-interval knot-resolver-garbage-collection-interval + (default 1000))) + +(define %kresd.conf + (plain-file "kresd.conf" "-- -*- mode: lua -*- +net = { '127.0.0.1', '::1' } +user('knot-resolver', 'knot-resolver') +modules = { 'hints > iterate', 'stats', 'predict' } +cache.size = 100 * MB +")) + +(define %knot-resolver-accounts + (list (user-group + (name "knot-resolver") + (system? #t)) + (user-account + (name "knot-resolver") + (group "knot-resolver") + (system? #t) + (home-directory "/var/cache/knot-resolver") + (shell (file-append shadow "/sbin/nologin"))))) + +(define (knot-resolver-activation config) + #~(begin + (use-modules (guix build utils)) + (let ((rundir "/var/cache/knot-resolver") + (owner (getpwnam "knot-resolver"))) + (mkdir-p rundir) + (chown rundir (passwd:uid owner) (passwd:gid owner))))) + +(define knot-resolver-shepherd-services + (match-lambda + (($ package + kresd-config-file + garbage-collection-interval) + (list + (shepherd-service + (provision '(kresd)) + (requirement '(networking)) + (documentation "Run the Knot Resolver daemon.") + (start #~(make-forkexec-constructor + '(#$(file-append package "/sbin/kresd") + "-c" #$kresd-config-file "-f" "1" + "/var/cache/knot-resolver"))) + (stop #~(make-kill-destructor))) + (shepherd-service + (provision '(kres-cache-gc)) + (requirement '(user-processes)) + (documentation "Run the Knot Resolver Garbage Collector daemon.") + (start #~(make-forkexec-constructor + '(#$(file-append package "/sbin/kres-cache-gc") + "-d" #$(number->string garbage-collection-interval) + "-c" "/var/cache/knot-resolver") + #:user "knot-resolver" + #:group "knot-resolver")) + (stop #~(make-kill-destructor))))))) + +(define knot-resolver-service-type + (service-type + (name 'knot-resolver) + (extensions + (list (service-extension shepherd-root-service-type + knot-resolver-shepherd-services) + (service-extension activation-service-type + knot-resolver-activation) + (service-extension account-service-type + (const %knot-resolver-accounts)))) + (default-value (knot-resolver-configuration)) + (description "Run the Knot DNS Resolver."))) + ;;; ;;; Dnsmasq. -- cgit v1.2.3 From a2161c861f8c971c5b9e547f1997be4b1d4ba529 Mon Sep 17 00:00:00 2001 From: Alex Griffin Date: Mon, 4 Nov 2019 19:29:24 -0600 Subject: services: Add pagekite-service-type. * gnu/services/networking.scm (pagekite-service-type): New service type. (): New record type. (pagekite-shepherd-service): New procedure. * doc/guix.texi (Networking Services): Document it. --- doc/guix.texi | 47 +++++++++++++++++++ gnu/services/networking.scm | 109 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 155 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 2622079bcb..242beb18c8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -67,6 +67,7 @@ Copyright @copyright{} 2019 Diego Nicola Barbato@* Copyright @copyright{} 2019 Ivan Petkov@* Copyright @copyright{} 2019 Jakob L. Kreuze@* Copyright @copyright{} 2019 Kyle Andrews@* +Copyright @copyright{} 2019 Alex Griffin@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -13978,6 +13979,52 @@ Package object of the Open vSwitch. @end table @end deftp +@defvr {Scheme Variable} pagekite-service-type +This is the service type for the @uref{https://pagekite.net, PageKite} service, +a tunneling solution for making localhost servers publicly visible, even from +behind NAT or restrictive firewalls. The value for this service type is a +@code{pagekite-configuration} record. + +Here's an example exposing the local HTTP and SSH daemons: + +@lisp +(service pagekite-service-type + (pagekite-configuration + (kites '("http:@@kitename:localhost:80:@@kitesecret" + "raw/22:@@kitename:localhost:22:@@kitesecret")) + (extra-file "/etc/pagekite.rc"))) +@end lisp +@end defvr + +@deftp {Data Type} pagekite-configuration +Data type representing the configuration of PageKite. + +@table @asis +@item @code{package} (default: @var{pagekite}) +Package object of PageKite. + +@item @code{kitename} (default: @code{#f}) +PageKite name for authenticating to the frontend server. + +@item @code{kitesecret} (default: @code{#f}) +Shared secret for authenticating to the frontend server. You should probably +put this inside @code{extra-file} instead. + +@item @code{frontend} (default: @code{#f}) +Connect to the named PageKite frontend server instead of the +@uref{https://pagekite.net,,pagekite.net} service. + +@item @code{kites} (default: @code{'("http:@@kitename:localhost:80:@@kitesecret")}) +List of service kites to use. Exposes HTTP on port 80 by default. The format +is @code{proto:kitename:host:port:secret}. + +@item @code{extra-file} (default: @code{#f}) +Extra configuration file to read, which you are expected to create manually. +Use this to add additional options and manage shared secrets out-of-band. + +@end table +@end deftp + @node X Window @subsection X Window diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index a1c1aad9f6..6485c08ff7 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -12,6 +12,7 @@ ;;; Copyright © 2019 Florian Pelz ;;; Copyright © 2019 Maxim Cournoyer ;;; Copyright © 2019 Sou Bunnbu +;;; Copyright © 2019 Alex Griffin ;;; ;;; This file is part of GNU Guix. ;;; @@ -154,7 +155,17 @@ nftables-configuration? nftables-configuration-package nftables-configuration-ruleset - %default-nftables-ruleset)) + %default-nftables-ruleset + + pagekite-service-type + pagekite-configuration + pagekite-configuration? + pagekite-configuration-package + pagekite-configuration-kitename + pagekite-configuration-kitesecret + pagekite-configuration-frontend + pagekite-configuration-kites + pagekite-configuration-extra-file)) ;;; Commentary: ;;; @@ -1527,4 +1538,100 @@ table inet filter { (compose list nftables-configuration-package)))) (default-value (nftables-configuration)))) + +;;; +;;; PageKite +;;; + +(define-record-type* + pagekite-configuration + make-pagekite-configuration + pagekite-configuration? + (package pagekite-configuration-package + (default pagekite)) + (kitename pagekite-configuration-kitename + (default #f)) + (kitesecret pagekite-configuration-kitesecret + (default #f)) + (frontend pagekite-configuration-frontend + (default #f)) + (kites pagekite-configuration-kites + (default '("http:@kitename:localhost:80:@kitesecret"))) + (extra-file pagekite-configuration-extra-file + (default #f))) + +(define (pagekite-configuration-file config) + (match-record config + (package kitename kitesecret frontend kites extra-file) + (mixed-text-file "pagekite.rc" + (if extra-file + (string-append "optfile = " extra-file "\n") + "") + (if kitename + (string-append "kitename = " kitename "\n") + "") + (if kitesecret + (string-append "kitesecret = " kitesecret "\n") + "") + (if frontend + (string-append "frontend = " frontend "\n") + "defaults\n") + (string-join (map (lambda (kite) + (string-append "service_on = " kite)) + kites) + "\n" + 'suffix)))) + +(define (pagekite-shepherd-service config) + (match-record config + (package kitename kitesecret frontend kites extra-file) + (with-imported-modules (source-module-closure + '((gnu build shepherd) + (gnu system file-systems))) + (shepherd-service + (documentation "Run the PageKite service.") + (provision '(pagekite)) + (requirement '(networking)) + (modules '((gnu build shepherd) + (gnu system file-systems))) + (start #~(make-forkexec-constructor/container + (list #$(file-append package "/bin/pagekite") + "--clean" + "--nullui" + "--nocrashreport" + "--runas=pagekite:pagekite" + (string-append "--optfile=" + #$(pagekite-configuration-file config))) + #:log-file "/var/log/pagekite.log" + #:mappings #$(if extra-file + #~(list (file-system-mapping + (source #$extra-file) + (target source))) + #~'()))) + ;; SIGTERM doesn't always work for some reason. + (stop #~(make-kill-destructor SIGINT)))))) + +(define %pagekite-accounts + (list (user-group (name "pagekite") (system? #t)) + (user-account + (name "pagekite") + (group "pagekite") + (system? #t) + (comment "PageKite user") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin"))))) + +(define pagekite-service-type + (service-type + (name 'pagekite) + (default-value (pagekite-configuration)) + (extensions + (list (service-extension shepherd-root-service-type + (compose list pagekite-shepherd-service)) + (service-extension account-service-type + (const %pagekite-accounts)))) + (description + "Run @url{https://pagekite.net/,PageKite}, a tunneling solution to make +local servers publicly accessible on the web, even behind NATs and firewalls."))) + ;;; networking.scm ends here -- cgit v1.2.3 From a01d2e300abf8721866c8d1f984b0db90d192f9d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 13 Nov 2019 22:07:51 +0100 Subject: services: dbus: Add description. * gnu/services/dbus.scm (dbus-root-service-type)[description]: New field. --- gnu/services/dbus.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index a697a8820e..db634fe0d8 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -229,7 +229,10 @@ includes the @code{etc/dbus-1/system.d} directories of each package listed in (append (dbus-configuration-services config) services))))) - (default-value (dbus-configuration)))) + (default-value (dbus-configuration)) + (description "Run the system-wide D-Bus inter-process message +bus. It allows programs and daemons to communicate and is also responsible +for spawning (@dfn{activating}) D-Bus services on demand."))) (define* (dbus-service #:key (dbus dbus) (services '())) "Return a service that runs the \"system bus\", using @var{dbus}, with -- cgit v1.2.3 From 7462a1de22636dde24d56225c67bb3c10118b698 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 13 Nov 2019 22:11:34 +0100 Subject: services: dbus: Log to syslog. * gnu/services/dbus.scm (dbus-shepherd-service): Add 'syslogd' to 'requirement'. Pass the "--syslog-only" command-line option. --- gnu/services/dbus.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index db634fe0d8..a97ce17c0c 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -195,10 +195,10 @@ includes the @code{etc/dbus-1/system.d} directories of each package listed in (list (shepherd-service (documentation "Run the D-Bus system daemon.") (provision '(dbus-system)) - (requirement '(user-processes)) + (requirement '(user-processes syslogd)) (start #~(make-forkexec-constructor (list (string-append #$dbus "/bin/dbus-daemon") - "--nofork" "--system") + "--nofork" "--system" "--syslog-only") #:pid-file "/var/run/dbus/pid")) (stop #~(make-kill-destructor))))))) -- cgit v1.2.3 From 1f8ca28b9e517f73d1a640dbbd11eadbf35b885b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 13 Nov 2019 22:30:49 +0100 Subject: services: dbus: Simplify 'dbus-uuidgen' invocation. * gnu/services/dbus.scm (dbus-activation): Use the "--ensure" option of 'dbus-uuidgen' instead of forking and redirecting ports. --- gnu/services/dbus.scm | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index a97ce17c0c..7b3c8100e2 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -176,18 +176,9 @@ includes the @code{etc/dbus-1/system.d} directories of each package listed in (unless (file-exists? "/etc/machine-id") (format #t "creating /etc/machine-id...~%") - (let ((prog (string-append #$(dbus-configuration-dbus config) - "/bin/dbus-uuidgen"))) - ;; XXX: We can't use 'system' because the initrd's - ;; guile system(3) only works when 'sh' is in $PATH. - (let ((pid (primitive-fork))) - (if (zero? pid) - (call-with-output-file "/etc/machine-id" - (lambda (port) - (close-fdes 1) - (dup2 (port->fdes port) 1) - (execl prog))) - (waitpid pid))))))) + (invoke (string-append #$(dbus-configuration-dbus config) + "/bin/dbus-uuidgen") + "--ensure=/etc/machine-id")))) (define dbus-shepherd-service (match-lambda -- cgit v1.2.3