diff --git a/doc/guix.texi b/doc/guix.texi index 7c37468cdf619c3005c66f36dce55cbccb24f8a1..bb96385f840cd9580c7360955560c045be3b581b 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 d8086b78d40c9c53e57544e0c6f2eec557994aae..deaf677bd9a495d859d5ced68e636206936d8bb2 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -58,8 +58,8 @@ (define (syslog-rotation-config files) } ")) -(define (simple-rotation-config file) - (string-append file " { +(define (simple-rotation-config files) + #~(string-append #$(string-join files ",") " { sharedscripts } ")) @@ -72,7 +72,8 @@ (define %default-rotations (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 f2bac297aa7e614a102532802db43868e44e414f..1b1ce0d5e8e37fd236c2116dd8490e2133bb357b 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1089,6 +1089,8 @@ (define-record-type* <guix-configuration> (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 ;<package> (default lsof))) @@ -1101,7 +1103,7 @@ (define (guix-shepherd-service config) (($ <guix-configuration> 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 @@ (define (guix-shepherd-service config) ;; 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)