summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-04 03:13:05 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-04 03:24:42 +0200
commitbaa1bdf70f21848fbe01d3f383ae0f59d86a9bf3 (patch)
tree6eab1fc07184788fd236d0ea2387d6e351683661 /src/core
parentfa229d09281d435153b4cfd138a2a62fa66d889b (diff)
main: change check whether /etc is unpopulated to look for /etc/machine-id
Previously, we checked whether /etc was completely empty. This makes it difficult though for container managers such as nspawn to install a small number of files (such as /etc/timezone), and have the system otherwise populate its own tree. Hence, change this by looking for /etc/machine-id, which should be a good sign whether /etc is populated or not.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 38835fc620..1ca899998e 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1543,7 +1543,7 @@ int main(int argc, char *argv[]) {
if (in_initrd())
log_info("Running in initial RAM disk.");
- empty_etc = dir_is_empty("/etc") > 0;
+ empty_etc = access("/etc/machine-id", F_OK) < 0;
if (empty_etc)
log_info("Running with unpopulated /etc.");
} else {