From 4c213d6cf416917c61f82d8bee795b8f3a4c5372 Mon Sep 17 00:00:00 2001 From: WaLyong Cho Date: Tue, 9 Dec 2014 16:07:16 +0900 Subject: run: introduce timer support option Support timer options --on-active=, --on-boot=, --on-startup=, --on-unit-active=, --on-unit-inactive=, --on-calendar=. Each options corresponding with OnActiveSec=, OnBootSec=, OnStartupSec=, OnUnitActiveSec=, OnUnitInactiveSec=, OnCalendar= of timer respectively. And OnCalendar= and WakeSystem= supported by --timer-property= option like --property= of systemd-run. And if --unit= option and timer options are specified the command can be omitted. In this case, systemd-run assumes the target service is already loaded. And just try to generate transient timer unit only. --- src/libsystemd/sd-bus/bus-util.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/libsystemd') diff --git a/src/libsystemd/sd-bus/bus-util.c b/src/libsystemd/sd-bus/bus-util.c index bdaa4494a1..0f1a89c8e1 100644 --- a/src/libsystemd/sd-bus/bus-util.c +++ b/src/libsystemd/sd-bus/bus-util.c @@ -1372,7 +1372,8 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen if (STR_IN_SET(field, "CPUAccounting", "MemoryAccounting", "BlockIOAccounting", - "SendSIGHUP", "SendSIGKILL")) { + "SendSIGHUP", "SendSIGKILL", + "WakeSystem")) { r = parse_boolean(eq); if (r < 0) { @@ -1533,6 +1534,17 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen r = sd_bus_message_append(m, "v", "i", sig); + } else if (streq(field, "AccuracySec")) { + usec_t u; + + r = parse_sec(eq, &u); + if (r < 0) { + log_error("Failed to parse %s value %s", field, eq); + return -EINVAL; + } + + r = sd_bus_message_append(m, "v", "t", u); + } else { log_error("Unknown assignment %s.", assignment); return -EINVAL; -- cgit v1.2.3-54-g00ecf