summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2015-10-15 09:57:28 +0000
committerEvgeny Vereshchagin <evvers@ya.ru>2015-10-15 09:57:28 +0000
commitf1db33275635c77ee01132a27235d4bc362f9d4a (patch)
tree81b149957a4cae8968b80bb739546a18f0cc76a7 /src
parent19833db683c1e197718f00d1d5cb4827ee7897d8 (diff)
run: can launch units with TimerSlackNSec
Diffstat (limited to 'src')
-rw-r--r--src/core/dbus-execute.c15
-rw-r--r--src/shared/bus-util.c9
2 files changed, 24 insertions, 0 deletions
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
index 8b1f830476..436229330e 100644
--- a/src/core/dbus-execute.c
+++ b/src/core/dbus-execute.c
@@ -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;
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index 3a45ac4064..a5d6edbba9 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -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;