summaryrefslogtreecommitdiff
path: root/src/shared/bus-unit-util.c
diff options
context:
space:
mode:
authorKristijan Gjoshev <crypter@mail.com>2020-02-01 18:27:08 +0100
committerAnita Zhang <the.anitazha@gmail.com>2020-11-05 10:59:33 -0800
commitacf24a1a84e9496e3feb09449f4cc43fe67a9a64 (patch)
tree4f0ea72d0e2f6b20aea5c51c489574c63ec0ef81 /src/shared/bus-unit-util.c
parent5cecbae158ed05b2376a605c9c9ef71eeef81472 (diff)
downloadsystemd-acf24a1a84e9496e3feb09449f4cc43fe67a9a64.tar.gz
timer: add new feature FixedRandomDelay=
FixedRandomDelay=yes will use `siphash24(sd_id128_get_machine() || MANAGER_IS_SYSTEM(m) || getuid() || u->id)`, where || is concatenation, instead of a random number to choose a value between 0 and RandomizedDelaySec= as the timer delay. This essentially sets up a fixed, but seemingly random, offset for each timer iteration rather than having a random offset recalculated each time it fires. Closes #10355 Co-author: Anita Zhang <the.anitazha@gmail.com>
Diffstat (limited to 'src/shared/bus-unit-util.c')
-rw-r--r--src/shared/bus-unit-util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c
index 79c2e0cf19..d1dc9e2e02 100644
--- a/src/shared/bus-unit-util.c
+++ b/src/shared/bus-unit-util.c
@@ -2074,7 +2074,8 @@ static int bus_append_timer_property(sd_bus_message *m, const char *field, const
"RemainAfterElapse",
"Persistent",
"OnTimezoneChange",
- "OnClockChange"))
+ "OnClockChange",
+ "FixedRandomDelay"))
return bus_append_parse_boolean(m, field, eq);
if (STR_IN_SET(field, "AccuracySec",