|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
From a821499e679a2d76c96ea6fda76e7847ba57a565 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
From: Lennart Poettering <lennart@poettering.net>
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Date: Mon, 7 Jul 2014 11:47:46 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Subject: [PATCH] main: explain our /etc empty check a bit in a comment
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
(cherry picked from commit 3408ba015aee3a88c91962c028738be757779519)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
src/core/main.c | 8 ++++++++
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
1 file changed, 8 insertions(+)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
diff --git a/src/core/main.c b/src/core/main.c
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
index 1ca899998e..a732c6945a 100644
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
--- a/src/core/main.c
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+++ b/src/core/main.c
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
@@ -1543,6 +1543,14 @@ int main(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
if (in_initrd())
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
log_info("Running in initial RAM disk.");
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ /* Let's check whether /etc is already populated. We
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ * don't actually really check for that, but use
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ * /etc/machine-id as flag file. This allows container
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ * managers and installers to provision a couple of
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ * files already. If the container manager wants to
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ * provision the machine ID itself it should pass
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ * $container_uuid to PID 1.*/
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
empty_etc = access("/etc/machine-id", F_OK) < 0;
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
if (empty_etc)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
log_info("Running with unpopulated /etc.");
|