summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-03-05 04:07:37 +0100
committerLennart Poettering <lennart@poettering.net>2014-03-05 04:08:04 +0100
commite567439ec6a63f07258d52fe383a538f5dbeb79b (patch)
tree4fde0bc7b5c545c274ba264b4d296c7ad26ce2ae /src/libsystemd/sd-bus
parentd584f638940366c46a48e34a25cf43e2b77475be (diff)
systemd-run: support all currently exported properties with -p
Diffstat (limited to 'src/libsystemd/sd-bus')
-rw-r--r--src/libsystemd/sd-bus/bus-util.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/libsystemd/sd-bus/bus-util.c b/src/libsystemd/sd-bus/bus-util.c
index d0ae43da4e..3b07993b2a 100644
--- a/src/libsystemd/sd-bus/bus-util.c
+++ b/src/libsystemd/sd-bus/bus-util.c
@@ -1252,7 +1252,9 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
if (r < 0)
return bus_log_create_error(r);
- if (STR_IN_SET(field, "CPUAccounting", "MemoryAccounting", "BlockIOAccounting")) {
+ if (STR_IN_SET(field,
+ "CPUAccounting", "MemoryAccounting", "BlockIOAccounting",
+ "SendSIGHUP", "SendSIGKILL")) {
r = parse_boolean(eq);
if (r < 0) {
@@ -1284,7 +1286,7 @@ 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, "DevicePolicy"))
+ } else if (STR_IN_SET(field, "User", "Group", "DevicePolicy", "KillMode"))
r = sd_bus_message_append(m, "v", "s", eq);
else if (streq(field, "DeviceAllow")) {
@@ -1387,6 +1389,32 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
r = sd_bus_message_append(m, "v", "t", rl);
+ } else if (streq(field, "Nice")) {
+ int32_t i;
+
+ r = safe_atoi32(eq, &i);
+ if (r < 0) {
+ log_error("Failed to parse %s value %s.", field, eq);
+ return -EINVAL;
+ }
+
+ r = sd_bus_message_append(m, "v", "i", i);
+
+ } else if (streq(field, "Environment")) {
+
+ r = sd_bus_message_append(m, "v", "as", 1, eq);
+
+ } else if (streq(field, "KillSignal")) {
+ int sig;
+
+ sig = signal_from_string_try_harder(eq);
+ if (sig < 0) {
+ log_error("Failed to parse %s value %s.", field, eq);
+ return -EINVAL;
+ }
+
+ r = sd_bus_message_append(m, "v", "i", sig);
+
} else {
log_error("Unknown assignment %s.", assignment);
return -EINVAL;