dcavalca / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone
6f381c
From f2de5398b0a1ebb3e6390506368c11329b843524 Mon Sep 17 00:00:00 2001
6f381c
From: Jan Macku <jamacku@redhat.com>
6f381c
Date: Thu, 2 Sep 2021 16:50:50 +0200
6f381c
Subject: [PATCH] core: Indicate the time when the manager started loading
6f381c
 units the last time
6f381c
6f381c
(cherry picked from commit 15b9243c0d7f6d1531fa65dbc01bd11e8e6c12ca)
6f381c
6f381c
Resolves: #2136869
6f381c
---
6f381c
 src/core/manager.c | 5 +++++
6f381c
 1 file changed, 5 insertions(+)
6f381c
6f381c
diff --git a/src/core/manager.c b/src/core/manager.c
6f381c
index 8aa398cac8..a9cd51b624 100644
6f381c
--- a/src/core/manager.c
6f381c
+++ b/src/core/manager.c
6f381c
@@ -3554,6 +3554,11 @@ int manager_reload(Manager *m) {
6f381c
         /* Let's finally catch up with any changes that took place while we were reloading/reexecing */
6f381c
         manager_catchup(m);
6f381c
 
6f381c
+        /* Create a file which will indicate when the manager started loading units the last time. */
6f381c
+        (void) touch_file("/run/systemd/systemd-units-load", false,
6f381c
+                m->timestamps[MANAGER_TIMESTAMP_UNITS_LOAD].realtime ?: now(CLOCK_REALTIME),
6f381c
+                UID_INVALID, GID_INVALID, 0444);
6f381c
+
6f381c
         /* Sync current state of bus names with our set of listening units */
6f381c
         q = manager_enqueue_sync_bus_names(m);
6f381c
         if (q < 0 && r >= 0)