mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-03 13:47:04 +03:00
Merge pull request #11608 from taro-yamada/add_persistent_randmized_delay
core: add "Persistent=delay" to delay persistent timers after boot
This commit is contained in:
commit
9fa326b18a
@ -380,6 +380,13 @@ static void timer_enter_waiting(Timer *t, bool time_change) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* To make the delay due to RandomizedDelaySec= work even at boot,
|
||||||
|
* if the scheduled time has already passed, set the time when systemd
|
||||||
|
* first started as the scheduled time.
|
||||||
|
* Also, we don't have to check t->persistent since the logic implicitly express true. */
|
||||||
|
if (v->next_elapse < UNIT(t)->manager->timestamps[MANAGER_TIMESTAMP_USERSPACE].realtime)
|
||||||
|
v->next_elapse = UNIT(t)->manager->timestamps[MANAGER_TIMESTAMP_USERSPACE].realtime;
|
||||||
|
|
||||||
if (!found_realtime)
|
if (!found_realtime)
|
||||||
t->next_elapse_realtime = v->next_elapse;
|
t->next_elapse_realtime = v->next_elapse;
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user