diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-12-07 18:47:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-07 18:47:25 +0100 |
commit | f333ed27fac2472ef5ab0d6fb980eea8353ced8d (patch) | |
tree | 0946f3908ba20ba79032fbb5e2dc02bb827a0e3b /src/core | |
parent | d40ce018147cece145a190949128f7f8adaeb2c6 (diff) | |
parent | 15b9243c0d7f6d1531fa65dbc01bd11e8e6c12ca (diff) | |
download | systemd-f333ed27fac2472ef5ab0d6fb980eea8353ced8d.tar.gz |
Merge pull request #20476 from jamacku/new-feature-reloaded-stamp
core: indicate the time when units were loaded
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/dbus-manager.c | 1 | ||||
-rw-r--r-- | src/core/manager.c | 8 | ||||
-rw-r--r-- | src/core/manager.h | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index 648728fdfb..9b64a8074d 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -2673,6 +2673,7 @@ const sd_bus_vtable bus_manager_vtable[] = { BUS_PROPERTY_DUAL_TIMESTAMP("GeneratorsFinishTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_GENERATORS_FINISH]), SD_BUS_VTABLE_PROPERTY_CONST), BUS_PROPERTY_DUAL_TIMESTAMP("UnitsLoadStartTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_UNITS_LOAD_START]), SD_BUS_VTABLE_PROPERTY_CONST), BUS_PROPERTY_DUAL_TIMESTAMP("UnitsLoadFinishTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_UNITS_LOAD_FINISH]), SD_BUS_VTABLE_PROPERTY_CONST), + BUS_PROPERTY_DUAL_TIMESTAMP("UnitsLoadTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_UNITS_LOAD]), SD_BUS_VTABLE_PROPERTY_CONST), BUS_PROPERTY_DUAL_TIMESTAMP("InitRDSecurityStartTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_INITRD_SECURITY_START]), SD_BUS_VTABLE_PROPERTY_CONST), BUS_PROPERTY_DUAL_TIMESTAMP("InitRDSecurityFinishTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_INITRD_SECURITY_FINISH]), SD_BUS_VTABLE_PROPERTY_CONST), BUS_PROPERTY_DUAL_TIMESTAMP("InitRDGeneratorsStartTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_INITRD_GENERATORS_START]), SD_BUS_VTABLE_PROPERTY_CONST), diff --git a/src/core/manager.c b/src/core/manager.c index 780b153913..c5c6e62868 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -1729,13 +1729,20 @@ static void manager_ready(Manager *m) { /* Let's finally catch up with any changes that took place while we were reloading/reexecing */ manager_catchup(m); + /* Create a file which will indicate when the manager started loading units the last time. */ + (void) touch_file("/run/systemd/systemd-units-load", false, + m->timestamps[MANAGER_TIMESTAMP_UNITS_LOAD].realtime ?: now(CLOCK_REALTIME), + UID_INVALID, GID_INVALID, 0444); + m->honor_device_enumeration = true; } Manager* manager_reloading_start(Manager *m) { m->n_reloading++; + dual_timestamp_get(m->timestamps + MANAGER_TIMESTAMP_UNITS_LOAD); return m; } + void manager_reloading_stopp(Manager **m) { if (*m) { assert((*m)->n_reloading > 0); @@ -4459,6 +4466,7 @@ static const char *const manager_timestamp_table[_MANAGER_TIMESTAMP_MAX] = { [MANAGER_TIMESTAMP_GENERATORS_FINISH] = "generators-finish", [MANAGER_TIMESTAMP_UNITS_LOAD_START] = "units-load-start", [MANAGER_TIMESTAMP_UNITS_LOAD_FINISH] = "units-load-finish", + [MANAGER_TIMESTAMP_UNITS_LOAD] = "units-load", [MANAGER_TIMESTAMP_INITRD_SECURITY_START] = "initrd-security-start", [MANAGER_TIMESTAMP_INITRD_SECURITY_FINISH] = "initrd-security-finish", [MANAGER_TIMESTAMP_INITRD_GENERATORS_START] = "initrd-generators-start", diff --git a/src/core/manager.h b/src/core/manager.h index a6b27c3777..e445e4d751 100644 --- a/src/core/manager.h +++ b/src/core/manager.h @@ -102,6 +102,7 @@ typedef enum ManagerTimestamp { MANAGER_TIMESTAMP_GENERATORS_FINISH, MANAGER_TIMESTAMP_UNITS_LOAD_START, MANAGER_TIMESTAMP_UNITS_LOAD_FINISH, + MANAGER_TIMESTAMP_UNITS_LOAD, MANAGER_TIMESTAMP_INITRD_SECURITY_START, MANAGER_TIMESTAMP_INITRD_SECURITY_FINISH, |