teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0843-core-Indicate-the-time-when-the-manager-started-load.patch

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