summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2015-10-09 12:37:50 +0000
committerEvgeny Vereshchagin <evvers@ya.ru>2015-10-09 12:37:50 +0000
commitde53c4174886898410fdce7eb7551a6a1ed19655 (patch)
tree434ef503bcfd73b069987374428653c921891993 /src
parent047d99337f2e32cf6fc88bf415d4a3ed2a286539 (diff)
systemd-run can now launch units with SyslogIdentifier
Diffstat (limited to 'src')
-rw-r--r--src/core/dbus-execute.c25
-rw-r--r--src/shared/bus-util.c2
2 files changed, 26 insertions, 1 deletions
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
index f902fd6f2d..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;
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index 16e5919d0a..52ec7eee7f 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -1494,7 +1494,7 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
"UtmpIdentifier", "UtmpMode", "PAMName", "TTYPath",
"StandardInput", "StandardOutput", "StandardError",
"Description", "Slice", "Type", "WorkingDirectory",
- "RootDirectory"))
+ "RootDirectory", "SyslogIdentifier"))
r = sd_bus_message_append(m, "v", "s", eq);
else if (streq(field, "DeviceAllow")) {