summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-09 17:06:22 +0300
committerLennart Poettering <lennart@poettering.net>2015-10-09 17:06:22 +0300
commit2c882b8bfa29937fb808fa1dd60c2a7ab0e8e85e (patch)
tree4c2b70c9206fde2ab64f11a5c26e4ccdfbe5cd83 /src/core
parentce3cef2c52d928709674d8447b6c49062dd14a96 (diff)
parentdc800d8406fa2af0720974a35b38cc3452ad7233 (diff)
Merge pull request #1512 from evverx/systemd-run-syslog-properties
systemd-run can launch units with SyslogIdentifier and SyslogLevelPrefix
Diffstat (limited to 'src/core')
-rw-r--r--src/core/dbus-execute.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
index adf613d328..030df55554 100644
--- a/src/core/dbus-execute.c
+++ b/src/core/dbus-execute.c
@@ -856,7 +856,32 @@ int bus_exec_context_set_transient_property(
}
return 1;
+ } else if (streq(name, "SyslogIdentifier")) {
+ const char *id;
+
+ r = sd_bus_message_read(message, "s", &id);
+ if (r < 0)
+ return r;
+
+ if (mode != UNIT_CHECK) {
+
+ if (isempty(id)) {
+ c->syslog_identifier = mfree(c->syslog_identifier);
+ } else {
+ char *t;
+ t = strdup(id);
+ if (!t)
+ return -ENOMEM;
+
+ free(c->syslog_identifier);
+ c->syslog_identifier = t;
+ }
+
+ unit_write_drop_in_private_format(u, mode, name, "SyslogIdentifier=%s\n", id);
+ }
+
+ return 1;
} else if (streq(name, "Nice")) {
int n;
@@ -998,7 +1023,7 @@ int bus_exec_context_set_transient_property(
} else if (STR_IN_SET(name,
"IgnoreSIGPIPE", "TTYVHangup", "TTYReset",
"PrivateTmp", "PrivateDevices", "PrivateNetwork",
- "NoNewPrivileges")) {
+ "NoNewPrivileges", "SyslogLevelPrefix")) {
int b;
r = sd_bus_message_read(message, "b", &b);
@@ -1020,6 +1045,8 @@ int bus_exec_context_set_transient_property(
c->private_network = b;
else if (streq(name, "NoNewPrivileges"))
c->no_new_privileges = b;
+ else if (streq(name, "SyslogLevelPrefix"))
+ c->syslog_level_prefix = b;
unit_write_drop_in_private_format(u, mode, name, "%s=%s\n", name, yes_no(b));
}