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'.
This commit is contained in:
		
							parent
							
								
									91bef86aa2
								
							
						
					
					
						commit
						6fc754c2d6
					
				
					 1 changed files with 15 additions and 6 deletions
				
			
		|  | @ -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 | ||||
|  |  | |||
		Reference in a new issue