]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: do not touch /run/systemd/systemd-units-load from user session instances
authorLuca Boccassi <luca.boccassi@microsoft.com>
Mon, 27 Dec 2021 18:22:43 +0000 (18:22 +0000)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 28 Dec 2021 13:07:02 +0000 (22:07 +0900)
Follow-up for: https://github.com/systemd/systemd/commit/15b9243c0d7f6d1531fa65dbc01bd11e8e6c12ca
Fixes: https://github.com/systemd/systemd/issues/21911
src/core/manager.c

index 9368a1dfa18655774b35dfc9f99ab6b83688b265..2946f5806666fbb387041bb149e044251823cb97 100644 (file)
@@ -1728,9 +1728,10 @@ static void manager_ready(Manager *m) {
         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);
+        if (MANAGER_IS_SYSTEM(m))
+                (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;
 }