diff mbox series

[kirkstone,13/24] sysvinit-inittab/start_getty: Fix respawn too fast

Message ID d9ebf258cbd3a5e2d51e7533ff3f005494064013.1661624569.git.steve@sakoman.com
State Accepted, archived
Commit 8b95138b09256df61578ddf7df16ef13bced1847
Headers show
Series [kirkstone,01/24] vim: Upgrade 9.0.0115 -> 9.0.0242 | expand

Commit Message

Steve Sakoman Aug. 27, 2022, 6:25 p.m. UTC
From: Bertrand Marquis <bertrand.marquis@arm.com>

When an entry in /dev does not exist, start_getty is returning directly.
As it is started from init in a respawn mode, it will loop infinitely.
In this case add a sleep inside start_getty to prevent the "Respawning
too fast" message popping up every 5 minutes.

This case is happening quite often when the system is started as an
hypervisor guest as the standard serial line is usually taken by it and
removed from the configuration.

This was triggered quite often running linux as dom0 on top of Xen on
arm as the serial line is taken by Xen and removed from the device tree.

Use the opportunity to replace one tab with spaces as the rest of the
file is using spaces.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 5a704d0ff4d95b6d3a67b80a0db2be66253e7d61)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/recipes-core/sysvinit/sysvinit-inittab/start_getty | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty b/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
index 699a1ead1a..3c31a95f7f 100644
--- a/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
+++ b/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
@@ -14,4 +14,7 @@  esac
 
 if [ -e /sys/class/tty/$2 -a -c /dev/$2 ]; then
 	${setsid:-} ${getty} -L $1 $2 $3
+else
+    # Prevent respawning to fast error if /dev entry does not exist
+    sleep 1000
 fi