Zbigniew Jędrzejewski-Szmek 5d6eed
From 007cdfc4cd2ce5ffe0a1b5eb6a5481d1b06c5184 Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek 5d6eed
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Zbigniew Jędrzejewski-Szmek 5d6eed
Date: Tue, 31 Jan 2017 00:34:33 -0500
Zbigniew Jędrzejewski-Szmek 5d6eed
Subject: [PATCH] units: restore Before dependencies for
Zbigniew Jędrzejewski-Szmek 5d6eed
 systemd-vconsole-setup.service
Zbigniew Jędrzejewski-Szmek 5d6eed
Zbigniew Jędrzejewski-Szmek 5d6eed
When the service is run in the initramfs, it is possible for it to get started
Zbigniew Jędrzejewski-Szmek 5d6eed
and not be fast enough to exit before the root switch happens. It is started
Zbigniew Jędrzejewski-Szmek 5d6eed
multiple times (depending on the consoles being detected), and runs
Zbigniew Jędrzejewski-Szmek 5d6eed
asynchronously, so this is quite likely. It'll then get killed by killall(),
Zbigniew Jędrzejewski-Szmek 5d6eed
and systemd will consider the service failed. To avoid all this, just wait
Zbigniew Jędrzejewski-Szmek 5d6eed
for the service to terminate on it's own.
Zbigniew Jędrzejewski-Szmek 5d6eed
Zbigniew Jędrzejewski-Szmek 5d6eed
Before=initrd-switch-root.target should be good for the initramfs, and
Zbigniew Jędrzejewski-Szmek 5d6eed
Before=shutdown.tuarget should be good for the real system, although it's
Zbigniew Jędrzejewski-Szmek 5d6eed
unlikely to make any difference there.
Zbigniew Jędrzejewski-Szmek 5d6eed
Zbigniew Jędrzejewski-Szmek 5d6eed
(cherry picked from commit 750e550eba362096d56a35104c6a32631aa67b8e)
Zbigniew Jędrzejewski-Szmek 5d6eed
---
Zbigniew Jędrzejewski-Szmek 5d6eed
 units/systemd-vconsole-setup.service.in | 1 +
Zbigniew Jędrzejewski-Szmek 5d6eed
 1 file changed, 1 insertion(+)
Zbigniew Jędrzejewski-Szmek 5d6eed
Zbigniew Jędrzejewski-Szmek 5d6eed
diff --git a/units/systemd-vconsole-setup.service.in b/units/systemd-vconsole-setup.service.in
Zbigniew Jędrzejewski-Szmek 5d6eed
index 2bd1fd1a5d..8bb75c6a4f 100644
Zbigniew Jędrzejewski-Szmek 5d6eed
--- a/units/systemd-vconsole-setup.service.in
Zbigniew Jędrzejewski-Szmek 5d6eed
+++ b/units/systemd-vconsole-setup.service.in
Zbigniew Jędrzejewski-Szmek 5d6eed
@@ -9,6 +9,7 @@
Zbigniew Jędrzejewski-Szmek 5d6eed
 Description=Setup Virtual Console
Zbigniew Jędrzejewski-Szmek 5d6eed
 Documentation=man:systemd-vconsole-setup.service(8) man:vconsole.conf(5)
Zbigniew Jędrzejewski-Szmek 5d6eed
 DefaultDependencies=no
Zbigniew Jędrzejewski-Szmek 5d6eed
+Before=initrd-switch-root.target shutdown.target
Zbigniew Jędrzejewski-Szmek 5d6eed
 ConditionPathExists=/dev/tty0
Zbigniew Jędrzejewski-Szmek 5d6eed
 
Zbigniew Jędrzejewski-Szmek 5d6eed
 [Service]