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