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.
This commit is contained in:
Ludovic Courtès 2016-12-19 23:54:39 +01:00
parent f78903f363
commit dc0ef095b3
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
3 changed files with 14 additions and 5 deletions

View File

@ -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.

View File

@ -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)

View File

@ -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 ;<package>
(default lsof)))
@ -1101,7 +1103,7 @@ failed to register hydra.gnu.org public key: ~a~%" status))))))))
(($ <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 @@ 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)