summaryrefslogtreecommitdiffstats
path: root/src/core/swap.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-05-19 15:50:04 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-05-19 17:46:30 +0200
commite019ea738d63d5f7803f378f8bd3e074d66be08f (patch)
treea8f337a6393fbe03eca19e34db3ffc0d09f585aa /src/core/swap.c
parentunits: order getty units after getty-pre.target unconditionally (diff)
downloadsystemd-e019ea738d63d5f7803f378f8bd3e074d66be08f.tar.xz
systemd-e019ea738d63d5f7803f378f8bd3e074d66be08f.zip
pid1: order units using TTYVHangup= after vconsole setup
The goal of this change is to delay getty services until after systemd-vconsole-setup has finished. systemd-vconsole-setup starts loadkeys, and it seems that when loadkeys is interrupted by the TTY hangup call we do when starting tty services [1], so that loadkeys starts getting EIO from the ioctl("/dev/tty1", KDSKBENT) syscall it does. Fixes #26908. [1] https://github.com/legionus/kbd/issues/92#issuecomment-1554451788 Initially I wanted to add ordering dependencies to individual units, but TTYVHangup= can be added to other various external units too. The solution with an implicit dependency should cover those cases too.
Diffstat (limited to 'src/core/swap.c')
-rw-r--r--src/core/swap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/swap.c b/src/core/swap.c
index c6e2c8b1bd..26a950b058 100644
--- a/src/core/swap.c
+++ b/src/core/swap.c
@@ -270,7 +270,11 @@ static int swap_add_default_dependencies(Swap *s) {
if (r < 0)
return r;
- return unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
+ r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
+ if (r < 0)
+ return r;
+
+ return exec_context_add_default_dependencies(UNIT(s), &s->exec_context);
}
static int swap_verify(Swap *s) {