diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-10-14 19:39:28 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-10-14 19:39:28 +0200 |
commit | 64f283c39b1b8311f4dd99466ecc8df7e4407950 (patch) | |
tree | 33528fafccaf94de0ec165007446ec662623973f /src/shared | |
parent | 6777e2ad7282bb52076b92e130cba17cebb81b02 (diff) | |
parent | e0d6e0fa55054b7eacf58c511abff710fef5712f (diff) |
Merge pull request #1528 from evverx/systemd-run-syslog-pri-fac
systemd-run can launch units with SyslogLevel and SyslogFacility
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/bus-util.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index 65922dd93b..3a45ac4064 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -1497,7 +1497,29 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen "RootDirectory", "SyslogIdentifier")) r = sd_bus_message_append(m, "v", "s", eq); - else if (streq(field, "DeviceAllow")) { + else if (streq(field, "SyslogLevel")) { + int level; + + level = log_level_from_string(eq); + if (level < 0) { + log_error("Failed to parse %s value %s.", field, eq); + return -EINVAL; + } + + r = sd_bus_message_append(m, "v", "i", level); + + } else if (streq(field, "SyslogFacility")) { + int facility; + + facility = log_facility_unshifted_from_string(eq); + if (facility < 0) { + log_error("Failed to parse %s value %s.", field, eq); + return -EINVAL; + } + + r = sd_bus_message_append(m, "v", "i", facility); + + } else if (streq(field, "DeviceAllow")) { if (isempty(eq)) r = sd_bus_message_append(m, "v", "a(ss)", 0); |