diff options
Diffstat (limited to 'gnu/services/admin.scm')
-rw-r--r-- | gnu/services/admin.scm | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index edd8ce59da..5cf74c6e4d 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -22,7 +22,7 @@ (define-module (gnu services admin) #:use-module (gnu packages admin) #:use-module ((gnu packages base) - #:select (canonical-package findutils)) + #:select (canonical-package findutils coreutils sed)) #:use-module (gnu packages certs) #:use-module (gnu packages package-management) #:use-module (gnu services) @@ -290,7 +290,7 @@ Old log files are removed or compressed according to the configuration.") "10 23 * * 0") (define %default-file-database-excluded-directories - ;; Directories excluded from the 'locate' database. + ;; Regexps of directories excluded from the 'locate' database. (list (%store-prefix) "/tmp" "/var/tmp" "/var/cache" ".*/\\.cache" "/run/udev")) @@ -319,10 +319,10 @@ is taken.") @command{updatedb} job (@pxref{Guile Syntax,,, mcron, GNU@tie{}mcron}).") (excluded-directories (string-list %default-file-database-excluded-directories) - "List of directories to ignore when building the file database. By -default, this includes @file{/tmp} and @file{/gnu/store}, which should instead -be indexed by @command{guix locate} (@pxref{Invoking guix locate}). This list -is passed to the @option{--prunepaths} option of + "List of regular expressions of directories to ignore when building the +file database. By default, this includes @file{/tmp} and @file{/gnu/store}; +the latter should instead be indexed by @command{guix locate} (@pxref{Invoking +guix locate}). This list is passed to the @option{--prunepaths} option of @command{updatedb} (@pxref{Invoking updatedb,,, find, GNU@tie{}Findutils}).")) (define (file-database-mcron-jobs configuration) @@ -330,11 +330,20 @@ is passed to the @option{--prunepaths} option of (package schedule excluded-directories) (let ((updatedb (program-file "updatedb" - #~(execl #$(file-append package "/bin/updatedb") - "updatedb" - #$(string-append "--prunepaths=" - (string-join - excluded-directories)))))) + #~(begin + ;; 'updatedb' is a shell script that expects various + ;; commands in $PATH. + (setenv "PATH" + (string-append #$package "/bin:" + #$(canonical-package coreutils) + "/bin:" + #$(canonical-package sed) + "/bin")) + (execl #$(file-append package "/bin/updatedb") + "updatedb" + #$(string-append "--prunepaths=" + (string-join + excluded-directories))))))) (list #~(job #$schedule #$updatedb))))) (define file-database-service-type |