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>
This commit is contained in:
Kristijan Gjoshev
2020-11-05 10:59:33 -08:00
committed by Anita Zhang
parent 5cecbae158
commit acf24a1a84
10 changed files with 62 additions and 2 deletions
+1
View File
@@ -59,6 +59,7 @@ struct Timer {
bool remain_after_elapse;
bool on_clock_change;
bool on_timezone_change;
bool fixed_random_delay;
char *stamp_path;
};