1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-28 20:25:25 +03:00

Allow timers to trigger timers (#8043)

Unlike any other unit type, it makes sense for a timer to start another
timer. It is an easy way to crate logical "and" between time conditions

for instance, every day but no less than 5' after boot can easily be
implemented by a OnBootSec triggering an OnCalendar.

This is particulary usefull with Persistant timers which tend to all fire
together at startup
This commit is contained in:
Boucman 2018-02-14 14:10:07 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent c83812b1c4
commit 49219a1c03

View File

@ -1745,9 +1745,8 @@ int config_parse_trigger_unit(
log_syntax(unit, LOG_ERR, filename, line, 0, "Unit type not valid, ignoring: %s", rvalue);
return 0;
}
if (type == u->type) {
log_syntax(unit, LOG_ERR, filename, line, 0, "Trigger cannot be of same type, ignoring: %s", rvalue);
if (unit_has_name(u, p)) {
log_syntax(unit, LOG_ERR, filename, line, 0, "Units cannot trigger themselves, ignoring: %s", rvalue);
return 0;
}