systemd-run can now launch units with SyslogIdentifier

This commit is contained in:
Evgeny Vereshchagin 2015-10-09 12:37:50 +00:00
parent 047d99337f
commit de53c41748
2 changed files with 26 additions and 1 deletions

View file

@ -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;

View file

@ -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")) {