summaryrefslogtreecommitdiff
path: root/src/run
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-12-05 18:31:32 +0100
committerLennart Poettering <lennart@poettering.net>2017-12-05 18:33:24 +0100
commitd147457cc907ace9bfde8fc08a27616b864973d1 (patch)
treeadc3f0a21199cd2968966d725cfce5ac791ccfd3 /src/run
parente22e69a31edd3089514436174f97d4d8d96ed194 (diff)
downloadsystemd-d147457cc907ace9bfde8fc08a27616b864973d1.tar.gz
systemd-d147457cc907ace9bfde8fc08a27616b864973d1.tar.bz2
systemd-d147457cc907ace9bfde8fc08a27616b864973d1.zip
run: run pty forwarder at higher event priority than the bus
We want any tty I/O to happen before we look at service messages, hence let's set priorities on them, and give tty I/O a higher priority.
Diffstat (limited to 'src/run')
-rw-r--r--src/run/run.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/run/run.c b/src/run/run.c
index db833c2903..bd9a6b2c81 100644
--- a/src/run/run.c
+++ b/src/run/run.c
@@ -1085,6 +1085,9 @@ static int start_transient_service(
return log_error_errno(r, "Failed to create PTY forwarder: %m");
pty_forward_set_handler(c.forward, pty_forward_handler, &c);
+
+ /* Make sure to process any TTY events before we process bus events */
+ (void) pty_forward_set_priority(c.forward, SD_EVENT_PRIORITY_IMPORTANT);
}
path = unit_dbus_path_from_name(service);
@@ -1100,7 +1103,7 @@ static int start_transient_service(
if (r < 0)
return log_error_errno(r, "Failed to add properties changed signal.");
- r = sd_bus_attach_event(bus, c.event, 0);
+ r = sd_bus_attach_event(bus, c.event, SD_EVENT_PRIORITY_NORMAL);
if (r < 0)
return log_error_errno(r, "Failed to attach bus to event loop.");