chiark / gitweb /
hostnamed: introduce systemd-hostnamed
[elogind.git] / src / nspawn.c
index cd528deb79314e487c0d042a96000be02d952e6d..6b0ba4e57f18e12234501ede131b1375c5a52fc6 100644 (file)
@@ -117,7 +117,7 @@ static int mount_all(const char *dest) {
                 { "sysfs",     "/sys",      "sysfs",     NULL,        MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, true },
                 { "tmpfs",     "/dev",      "tmpfs",     "mode=755",  MS_NOSUID, true },
                 { "/dev/pts",  "/dev/pts",  "bind",      NULL,        MS_BIND, true },
-                { "tmpfs",     "/dev/.run", "tmpfs",     "mode=755",  MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
+                { "tmpfs",     "/run",      "tmpfs",     "mode=755",  MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
 #ifdef HAVE_SELINUX
                 { "selinux",   "/selinux",  "selinuxfs", NULL,        MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, false },
 #endif
@@ -125,9 +125,9 @@ static int mount_all(const char *dest) {
 
         unsigned k;
         int r = 0;
+        char *where;
 
         for (k = 0; k < ELEMENTSOF(mount_table); k++) {
-                char *where;
                 int t;
 
                 if (asprintf(&where, "%s/%s", dest, mount_table[k].where) < 0) {
@@ -167,6 +167,13 @@ static int mount_all(const char *dest) {
                 free(where);
         }
 
+        /* Fix the timezone, if possible */
+        if (asprintf(&where, "%s/%s", dest, "/etc/localtime") >= 0) {
+                mount("/etc/localtime", where, "bind", MS_BIND, NULL);
+                mount("/etc/localtime", where, "bind", MS_BIND|MS_REMOUNT|MS_RDONLY, NULL);
+                free(where);
+        }
+
         return r;
 }