shepherd: Include /etc/localtime in service containers.
authorLudovic Courtès <ludo@gnu.org>
Fri, 3 May 2019 15:12:09 +0000 (17:12 +0200)
committerLudovic Courtès <ludo@gnu.org>
Fri, 3 May 2019 15:47:29 +0000 (17:47 +0200)
Fixes a bug whereby Tor (for example) would emit syslog messages with a
UTC timestamp instead of local time.

* gnu/build/shepherd.scm (default-mounts): Add /etc/localtime to
MAPPINGS.

gnu/build/shepherd.scm

index f383259..cf68f21 100644 (file)
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
                                        (not (memq 'user namespaces)))
                                   accounts
                                   '())
+
+                            ;; Tell the process what timezone we're in.  This
+                            ;; makes sure that, for instance, its syslog
+                            ;; messages have the correct timestamp.
+                            ,(file-system-mapping
+                              (source "/etc/localtime")
+                              (target source))
+
                             ,%store-mapping)))    ;XXX: coarse-grain
             (map file-system-mapping->bind-mount
                  (filter (lambda (mapping)