summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/dbus-execute.c27
-rw-r--r--src/core/main.c7
-rw-r--r--src/libsystemd/sd-bus/busctl.c9
-rw-r--r--src/shared/bus-util.c3
4 files changed, 36 insertions, 10 deletions
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
index fd13c6d019..868c8cc05a 100644
--- a/src/core/dbus-execute.c
+++ b/src/core/dbus-execute.c
@@ -847,27 +847,36 @@ int bus_exec_context_set_transient_property(
return 1;
- } else if (streq(name, "TTYPath")) {
- const char *tty;
+ } else if (STR_IN_SET(name,
+ "TTYPath", "WorkingDirectory", "RootDirectory")) {
+ const char *s;
- r = sd_bus_message_read(message, "s", &tty);
+ r = sd_bus_message_read(message, "s", &s);
if (r < 0)
return r;
- if (!path_is_absolute(tty))
- return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "TTY device not absolute path");
+ if (!path_is_absolute(s))
+ return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "%s takes an absolute path", name);
if (mode != UNIT_CHECK) {
char *t;
- t = strdup(tty);
+ t = strdup(s);
if (!t)
return -ENOMEM;
- free(c->tty_path);
- c->tty_path = t;
+ if (streq(name, "TTYPath")) {
+ free(c->tty_path);
+ c->tty_path = t;
+ } else if (streq(name, "WorkingDirectory")) {
+ free(c->working_directory);
+ c->working_directory = t;
+ } else if (streq(name, "RootDirectory")) {
+ free(c->root_directory);
+ c->root_directory = t;
+ }
- unit_write_drop_in_private_format(u, mode, name, "TTYPath=%s\n", tty);
+ unit_write_drop_in_private_format(u, mode, name, "%s=%s\n", name, s);
}
return 1;
diff --git a/src/core/main.c b/src/core/main.c
index 9c1f8648e7..b57f4c1b7a 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1807,6 +1807,13 @@ int main(int argc, char *argv[]) {
goto finish;
case MANAGER_EXIT:
+ if (m->running_as == MANAGER_USER) {
+ retval = EXIT_SUCCESS;
+ log_debug("Exit.");
+ goto finish;
+ }
+
+ /* fallthrough */
case MANAGER_REBOOT:
case MANAGER_POWEROFF:
case MANAGER_HALT:
diff --git a/src/libsystemd/sd-bus/busctl.c b/src/libsystemd/sd-bus/busctl.c
index 09eba51d1c..5d07d5809c 100644
--- a/src/libsystemd/sd-bus/busctl.c
+++ b/src/libsystemd/sd-bus/busctl.c
@@ -1096,6 +1096,15 @@ static int monitor(sd_bus *bus, char *argv[], int (*dump)(sd_bus_message *m, FIL
if (r < 0)
return log_error_errno(r, "Failed to add match: %m");
+ free(m);
+ m = strjoin("destination='", *i, "'", NULL);
+ if (!m)
+ return log_oom();
+
+ r = sd_bus_add_match(bus, NULL, m, NULL, NULL);
+ if (r < 0)
+ return log_error_errno(r, "Failed to add match: %m");
+
added_something = true;
}
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index fdf41cec19..16b17c2c82 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -1492,7 +1492,8 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
"User", "Group", "DevicePolicy", "KillMode",
"UtmpIdentifier", "UtmpMode", "PAMName", "TTYPath",
"StandardInput", "StandardOutput", "StandardError",
- "Description", "Slice", "Type"))
+ "Description", "Slice", "Type", "WorkingDirectory",
+ "RootDirectory"))
r = sd_bus_message_append(m, "v", "s", eq);
else if (streq(field, "DeviceAllow")) {