Skip to content
Snippets Groups Projects
Unverified Commit dc0ef095 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

services: guix: Add 'log-file' configuration option.

* gnu/services/base.scm (<guix-configuration>)[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.
parent f78903f3
No related branches found
No related tags found
No related merge requests found
...@@ -8299,6 +8299,10 @@ The list of URLs where to look for substitutes by default. ...@@ -8299,6 +8299,10 @@ The list of URLs where to look for substitutes by default.
@item @code{extra-options} (default: @code{'()}) @item @code{extra-options} (default: @code{'()})
List of extra command-line options for @command{guix-daemon}. 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}) @item @code{lsof} (default: @var{lsof})
The lsof package to use. The lsof package to use.
   
......
...@@ -58,8 +58,8 @@ (define (syslog-rotation-config files) ...@@ -58,8 +58,8 @@ (define (syslog-rotation-config files)
} }
")) "))
(define (simple-rotation-config file) (define (simple-rotation-config files)
(string-append file " { #~(string-append #$(string-join files ",") " {
sharedscripts sharedscripts
} }
")) "))
...@@ -72,7 +72,8 @@ (define %default-rotations ...@@ -72,7 +72,8 @@ (define %default-rotations
(display #$(syslog-rotation-config %rotated-files) (display #$(syslog-rotation-config %rotated-files)
port) port)
(display #$(simple-rotation-config (display #$(simple-rotation-config
"/var/log/shepherd.log") '("/var/log/shepherd.log"
"/var/log/guix-daemon.log"))
port))))))) port)))))))
(define (default-jobs rottlog) (define (default-jobs rottlog)
......
...@@ -1089,6 +1089,8 @@ (define-record-type* <guix-configuration> ...@@ -1089,6 +1089,8 @@ (define-record-type* <guix-configuration>
(default %default-substitute-urls)) (default %default-substitute-urls))
(extra-options guix-configuration-extra-options ;list of strings (extra-options guix-configuration-extra-options ;list of strings
(default '())) (default '()))
(log-file guix-configuration-log-file ;string
(default "/var/log/guix-daemon.log"))
(lsof guix-configuration-lsof ;<package> (lsof guix-configuration-lsof ;<package>
(default lsof))) (default lsof)))
...@@ -1101,7 +1103,7 @@ (define (guix-shepherd-service config) ...@@ -1101,7 +1103,7 @@ (define (guix-shepherd-service config)
(($ <guix-configuration> guix build-group build-accounts (($ <guix-configuration> guix build-group build-accounts
authorize-key? keys authorize-key? keys
use-substitutes? substitute-urls extra-options use-substitutes? substitute-urls extra-options
lsof) log-file lsof)
(list (shepherd-service (list (shepherd-service
(documentation "Run the Guix daemon.") (documentation "Run the Guix daemon.")
(provision '(guix-daemon)) (provision '(guix-daemon))
...@@ -1118,7 +1120,9 @@ (define (guix-shepherd-service config) ...@@ -1118,7 +1120,9 @@ (define (guix-shepherd-service config)
;; Add 'lsof' (for the GC) to the daemon's $PATH. ;; Add 'lsof' (for the GC) to the daemon's $PATH.
#:environment-variables #:environment-variables
(list (string-append "PATH=" #$lsof "/bin")))) (list (string-append "PATH=" #$lsof "/bin"))
#:log-file #$log-file))
(stop #~(make-kill-destructor))))))) (stop #~(make-kill-destructor)))))))
(define (guix-accounts config) (define (guix-accounts config)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment