From 9fc037fe1099f499acc01c5f40cae7f72796c49a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 19 Dec 2016 15:41:19 +0100 Subject: services: Use 'file-append' in more places. * gnu/services/avahi.scm (avahi-shepherd-service): Use #$(file-append x y) instead of (string-append #$x y). * gnu/services/base.scm (unicode-start) (console-keymap-service-type, console-font-shepherd-services) (mingetty-shepherd-service, nscd-shepherd-service) (hydra-key-authorization, guix-shepherd-service) (guix-publish-shepherd-service, udev-shepherd-service) (gpm-shepherd-service, ) (kmscon-service-type): Likewise. * gnu/services/shepherd.scm (shepherd-boot-gexp): Likewise. --- gnu/services/base.scm | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'gnu/services/base.scm') diff --git a/gnu/services/base.scm b/gnu/services/base.scm index ea1ab63d1b..8e686898c5 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -610,7 +610,7 @@ strings or string-valued gexps." (dup2 (open-fdes #$tty O_RDONLY) 0) (close-fdes 1) (dup2 (open-fdes #$tty O_WRONLY) 1) - (execl (string-append #$kbd "/bin/unicode_start") + (execl #$(file-append kbd "/bin/unicode_start") "unicode_start")) (else (zero? (cdr (waitpid pid)))))))) @@ -623,7 +623,7 @@ strings or string-valued gexps." (documentation (string-append "Load console keymap (loadkeys).")) (provision '(console-keymap)) (start #~(lambda _ - (zero? (system* (string-append #$kbd "/bin/loadkeys") + (zero? (system* #$(file-append kbd "/bin/loadkeys") #$@files)))) (respawn? #f))))) @@ -655,7 +655,7 @@ strings or string-valued gexps." (start #~(lambda _ (and #$(unicode-start device) (zero? - (system* (string-append #$kbd "/bin/setfont") + (system* #$(file-append kbd "/bin/setfont") "-C" #$device #$font))))) (stop #~(const #t)) (respawn? #f))))) @@ -737,7 +737,7 @@ the message of the day, among other things." (requirement '(user-processes host-name udev)) (start #~(make-forkexec-constructor - (list (string-append #$mingetty "/sbin/mingetty") + (list #$(file-append mingetty "/sbin/mingetty") "--noclear" #$tty #$@(if auto-login #~("--autologin" #$auto-login) @@ -872,7 +872,7 @@ the tty to run, among other things." (provision '(nscd)) (requirement '(user-processes)) (start #~(make-forkexec-constructor - (list (string-append #$(nscd-configuration-glibc config) + (list #$(file-append (nscd-configuration-glibc config) "/sbin/nscd") "-f" #$nscd.conf "--foreground") @@ -1058,7 +1058,7 @@ public key, with GUIX." (format #t "registering public key '~a'...~%" key) (close-port (current-input-port)) (dup port 0) - (execl (string-append #$guix "/bin/guix") + (execl #$(file-append guix "/bin/guix") "guix" "archive" "--authorize") (exit 1))) (else @@ -1111,7 +1111,7 @@ failed to register hydra.gnu.org public key: ~a~%" status)))))))) (requirement '(user-processes)) (start #~(make-forkexec-constructor - (list (string-append #$guix "/bin/guix-daemon") + (list #$(file-append guix "/bin/guix-daemon") "--build-users-group" #$build-group #$@(if use-substitutes? '() @@ -1186,7 +1186,7 @@ failed to register hydra.gnu.org public key: ~a~%" status)))))))) (provision '(guix-publish)) (requirement '(guix-daemon)) (start #~(make-forkexec-constructor - (list (string-append #$guix "/bin/guix") + (list #$(file-append guix "/bin/guix") "publish" "-u" "guix-publish" "-p" #$(number->string port) (string-append "--listen=" #$host)))) @@ -1340,7 +1340,7 @@ item of @var{packages}." ;; The first one is for udev, the second one for eudev. (setenv "UDEV_CONFIG_FILE" #$udev.conf) (setenv "EUDEV_RULES_DIRECTORY" - (string-append #$rules "/lib/udev/rules.d")) + #$(file-append rules "/lib/udev/rules.d")) (let ((pid (primitive-fork))) (case pid @@ -1353,11 +1353,11 @@ item of @var{packages}." (wait-for-udevd) ;; Trigger device node creation. - (system* (string-append #$udev "/bin/udevadm") + (system* #$(file-append udev "/bin/udevadm") "trigger" "--action=add") ;; Wait for things to settle down. - (system* (string-append #$udev "/bin/udevadm") + (system* #$(file-append udev "/bin/udevadm") "settle") pid))))) (stop #~(make-kill-destructor)) @@ -1428,7 +1428,7 @@ extra rules from the packages listed in @var{rules}." ;; 'gpm' runs in the background and sets a PID file. ;; Note that it requires running as "root". (false-if-exception (delete-file "/var/run/gpm.pid")) - (fork+exec-command (list (string-append #$gpm "/sbin/gpm") + (fork+exec-command (list #$(file-append gpm "/sbin/gpm") #$@options)) ;; Wait for the PID file to appear; declare failure if @@ -1443,7 +1443,7 @@ extra rules from the packages listed in @var{rules}." (stop #~(lambda (_) ;; Return #f if successfully stopped. - (not (zero? (system* (string-append #$gpm "/sbin/gpm") + (not (zero? (system* #$(file-append gpm "/sbin/gpm") "-k")))))))))) (define gpm-service-type @@ -1472,7 +1472,7 @@ This service is not part of @var{%base-services}." (default kmscon)) (virtual-terminal kmscon-configuration-virtual-terminal) (login-program kmscon-configuration-login-program - (default #~(string-append #$shadow "/bin/login"))) + (default (file-append shadow "/bin/login"))) (login-arguments kmscon-configuration-login-arguments (default '("-p"))) (hardware-acceleration? kmscon-configuration-hardware-acceleration? @@ -1490,7 +1490,7 @@ This service is not part of @var{%base-services}." (define kmscon-command #~(list - (string-append #$kmscon "/bin/kmscon") "--login" + #$(file-append kmscon "/bin/kmscon") "--login" "--vt" #$virtual-terminal #$@(if hardware-acceleration? '("--hwaccel") '()) "--" #$login-program #$@login-arguments)) -- cgit v1.2.3 From f78903f36308081eeea52223fb3f5dca5096baef Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 19 Dec 2016 23:39:43 +0100 Subject: services: guix: Remove dependency on lsh. * gnu/services/base.scm ()[lsh]: Remove. (guix-shepherd-service): Remove lsh from 'PATH'. * doc/guix.texi (Base Services): Adjust accordingly. --- doc/guix.texi | 3 +-- gnu/services/base.scm | 12 ++++-------- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'gnu/services/base.scm') diff --git a/doc/guix.texi b/doc/guix.texi index c2182093dd..7c37468cdf 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -8300,8 +8300,7 @@ The list of URLs where to look for substitutes by default. List of extra command-line options for @command{guix-daemon}. @item @code{lsof} (default: @var{lsof}) -@itemx @code{lsh} (default: @var{lsh}) -The lsof and lsh packages to use. +The lsof package to use. @end table @end deftp diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 8e686898c5..f2bac297aa 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -37,7 +37,6 @@ #:use-module ((gnu packages base) #:select (canonical-package glibc)) #:use-module (gnu packages package-management) - #:use-module (gnu packages ssh) #:use-module (gnu packages lsof) #:use-module (gnu packages terminals) #:use-module ((gnu build file-systems) @@ -1091,9 +1090,7 @@ failed to register hydra.gnu.org public key: ~a~%" status)))))))) (extra-options guix-configuration-extra-options ;list of strings (default '())) (lsof guix-configuration-lsof ; - (default lsof)) - (lsh guix-configuration-lsh ; - (default lsh))) + (default lsof))) (define %default-guix-configuration (guix-configuration)) @@ -1104,7 +1101,7 @@ failed to register hydra.gnu.org public key: ~a~%" status)))))))) (($ guix build-group build-accounts authorize-key? keys use-substitutes? substitute-urls extra-options - lsof lsh) + lsof) (list (shepherd-service (documentation "Run the Guix daemon.") (provision '(guix-daemon)) @@ -1119,10 +1116,9 @@ failed to register hydra.gnu.org public key: ~a~%" status)))))))) "--substitute-urls" #$(string-join substitute-urls) #$@extra-options) - ;; Add 'lsof' (for the GC) and 'lsh' (for offloading) to the - ;; daemon's $PATH. + ;; Add 'lsof' (for the GC) to the daemon's $PATH. #:environment-variables - (list (string-append "PATH=" #$lsof "/bin:" #$lsh "/bin")))) + (list (string-append "PATH=" #$lsof "/bin")))) (stop #~(make-kill-destructor))))))) (define (guix-accounts config) -- cgit v1.2.3 From dc0ef095b32f57a935764d40530af0b32a01d715 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 19 Dec 2016 23:54:39 +0100 Subject: services: guix: Add 'log-file' configuration option. * gnu/services/base.scm ()[log-file]: New field. (guix-shepherd-service): Pass #:log-file to 'make-forkexec-constructor'. * gnu/services/admin.scm (simple-rotation-config): Take a list of files and join them with commas. (%default-rotations): Add /var/log/guix-daemon.log. * doc/guix.texi (Base Services): Document it. --- doc/guix.texi | 4 ++++ gnu/services/admin.scm | 7 ++++--- gnu/services/base.scm | 8 ++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'gnu/services/base.scm') diff --git a/doc/guix.texi b/doc/guix.texi index 7c37468cdf..bb96385f84 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -8299,6 +8299,10 @@ The list of URLs where to look for substitutes by default. @item @code{extra-options} (default: @code{'()}) List of extra command-line options for @command{guix-daemon}. +@item @code{log-file} (default: @code{"/var/log/guix-daemon.log"}) +File where @command{guix-daemon}'s standard output and standard error +are written. + @item @code{lsof} (default: @var{lsof}) The lsof package to use. diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index d8086b78d4..deaf677bd9 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -58,8 +58,8 @@ } ")) -(define (simple-rotation-config file) - (string-append file " { +(define (simple-rotation-config files) + #~(string-append #$(string-join files ",") " { sharedscripts } ")) @@ -72,7 +72,8 @@ (display #$(syslog-rotation-config %rotated-files) port) (display #$(simple-rotation-config - "/var/log/shepherd.log") + '("/var/log/shepherd.log" + "/var/log/guix-daemon.log")) port))))))) (define (default-jobs rottlog) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index f2bac297aa..1b1ce0d5e8 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1089,6 +1089,8 @@ failed to register hydra.gnu.org public key: ~a~%" status)))))))) (default %default-substitute-urls)) (extra-options guix-configuration-extra-options ;list of strings (default '())) + (log-file guix-configuration-log-file ;string + (default "/var/log/guix-daemon.log")) (lsof guix-configuration-lsof ; (default lsof))) @@ -1101,7 +1103,7 @@ failed to register hydra.gnu.org public key: ~a~%" status)))))))) (($ guix build-group build-accounts authorize-key? keys use-substitutes? substitute-urls extra-options - lsof) + log-file lsof) (list (shepherd-service (documentation "Run the Guix daemon.") (provision '(guix-daemon)) @@ -1118,7 +1120,9 @@ failed to register hydra.gnu.org public key: ~a~%" status)))))))) ;; Add 'lsof' (for the GC) to the daemon's $PATH. #:environment-variables - (list (string-append "PATH=" #$lsof "/bin")))) + (list (string-append "PATH=" #$lsof "/bin")) + + #:log-file #$log-file)) (stop #~(make-kill-destructor))))))) (define (guix-accounts config) -- cgit v1.2.3