From 6fc754c2d670d49f5a843d4b36729af95cf02d18 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 22 Aug 2023 10:20:11 +0200 Subject: services: file-database: Set 'PATH' for 'updatedb'. Previously 'updatedb' would fail to find 'sed', 'rm', etc. * gnu/services/admin.scm (file-database-mcron-jobs): Set PATH before invoking 'updatedb'. --- gnu/services/admin.scm | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index edd8ce59da..fa2407ed84 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) @@ -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 -- cgit 1.4.1