From 87852706ee33eaaa774ee5f361824c2e9b3b2fdb Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 19 Aug 2020 17:05:44 +0200 Subject: user-runtime-dir: deal gracefully with missing logind properties Fixes: #16685 (cherry picked from commit 5d1e68b49489574ef57947c5f1adfc761547eea9) (cherry picked from commit 6cd058f305dce7aa6b20d88496b80a5dd25745d3) (cherry picked from commit 590b9f585c77848b6df1d254dc51bb736cfc192d) (cherry picked from commit 677fb2b663e25484e91f16ffad16c118c46e7879) --- src/login/user-runtime-dir.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/login/user-runtime-dir.c b/src/login/user-runtime-dir.c index c8a5625605..da1df47b7f 100644 --- a/src/login/user-runtime-dir.c +++ b/src/login/user-runtime-dir.c @@ -6,9 +6,12 @@ #include "sd-bus.h" #include "bus-error.h" +#include "dev-setup.h" #include "fs-util.h" #include "format-util.h" +#include "fs-util.h" #include "label.h" +#include "limits-util.h" #include "main-func.h" #include "mkdir.h" #include "mountpoint-util.h" @@ -31,8 +34,10 @@ static int acquire_runtime_dir_size(uint64_t *ret) { return log_error_errno(r, "Failed to connect to system bus: %m"); r = sd_bus_get_property_trivial(bus, "org.freedesktop.login1", "/org/freedesktop/login1", "org.freedesktop.login1.Manager", "RuntimeDirectorySize", &error, 't', ret); - if (r < 0) - return log_error_errno(r, "Failed to acquire runtime directory size: %s", bus_error_message(&error, r)); + if (r < 0) { + log_warning_errno(r, "Failed to acquire runtime directory size, ignoring: %s", bus_error_message(&error, r)); + *ret = physical_memory_scale(10U, 100U); /* 10% */ + } return 0; } -- cgit v1.2.1