]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemd-run can now launch units with SyslogIdentifier
authorEvgeny Vereshchagin <evvers@ya.ru>
Fri, 9 Oct 2015 12:37:50 +0000 (12:37 +0000)
committerEvgeny Vereshchagin <evvers@ya.ru>
Fri, 9 Oct 2015 12:37:50 +0000 (12:37 +0000)
src/core/dbus-execute.c
src/shared/bus-util.c

index f902fd6f2dc28167582e4be3727b3c782c3b6aa4..030df555548fe17525ca006d0ff1e29082c7845a 100644 (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;
 
index 16e5919d0a8e2a2e7d739230f658dfdac7ade573..52ec7eee7f62f9f35b74aa8c7b59ca555843524c 100644 (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")) {