1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00

run: can launch units with TimerSlackNSec

This commit is contained in:
Evgeny Vereshchagin 2015-10-15 09:57:28 +00:00
parent 19833db683
commit f1db332756
2 changed files with 24 additions and 0 deletions

View File

@ -1171,6 +1171,21 @@ int bus_exec_context_set_transient_property(
return 1;
} else if (streq(name, "TimerSlackNSec")) {
nsec_t n;
r = sd_bus_message_read(message, "t", &n);
if (r < 0)
return r;
if (mode != UNIT_CHECK) {
c->timer_slack_nsec = n;
unit_write_drop_in_private_format(u, mode, name, "TimerSlackNSec=" NSEC_FMT "\n", n);
}
return 1;
} else if (rlimit_from_string(name) >= 0) {
uint64_t rl;
rlim_t x;

View File

@ -1655,7 +1655,16 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
}
r = sd_bus_message_append(m, "v", "t", u);
} else if (streq(field, "TimerSlackNSec")) {
nsec_t n;
r = parse_nsec(eq, &n);
if (r < 0) {
log_error("Failed to parse %s value %s", field, eq);
return -EINVAL;
}
r = sd_bus_message_append(m, "v", "t", n);
} else {
log_error("Unknown assignment %s.", assignment);
return -EINVAL;