ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
923a60
From c37bc5ac3a7282cccd090d20a3cf7120e31c4ee5 Mon Sep 17 00:00:00 2001
923a60
From: Jan Pazdziora <jpazdziora@redhat.com>
923a60
Date: Fri, 13 Mar 2015 12:57:18 +0100
923a60
Subject: [PATCH] console-getty.service: don't start when /dev/console is
923a60
 missing
923a60
923a60
Create minimal image which runs systemd
923a60
923a60
   FROM rhel7.1
923a60
   RUN yum install -y /usr/bin/ps
923a60
   ENV container docker
923a60
   CMD [ "/usr/sbin/init" ]
923a60
923a60
When you run the container without -t, the process
923a60
923a60
   /sbin/agetty --noclear --keep-baud console 115200 38400 9600
923a60
923a60
is not happy and checking the journal in the container, there is a stream of
923a60
923a60
Mar 13 04:50:15 11bf07f59fff agetty[66]: /dev/console: No such file or directory
923a60
Mar 13 04:50:25 11bf07f59fff systemd[1]: console-getty.service holdoff time over, scheduling restart.
923a60
Mar 13 04:50:25 11bf07f59fff systemd[1]: Stopping Console Getty...
923a60
Mar 13 04:50:25 11bf07f59fff systemd[1]: Starting Console Getty...
923a60
Mar 13 04:50:25 11bf07f59fff systemd[1]: Started Console Getty.
923a60
Mar 13 04:50:25 11bf07f59fff agetty[67]: /dev/console: No such file or directory
923a60
Mar 13 04:50:35 11bf07f59fff systemd[1]: console-getty.service holdoff time over, scheduling restart.
923a60
Mar 13 04:50:35 11bf07f59fff systemd[1]: Stopping Console Getty...
923a60
Mar 13 04:50:35 11bf07f59fff systemd[1]: Starting Console Getty...
923a60
Mar 13 04:50:35 11bf07f59fff systemd[1]: Started Console Getty.
923a60
Mar 13 04:50:35 11bf07f59fff agetty[74]: /dev/console: No such file or directory
923a60
Mar 13 04:50:45 11bf07f59fff systemd[1]: console-getty.service holdoff time over, scheduling restart.
923a60
Mar 13 04:50:45 11bf07f59fff systemd[1]: Stopping Console Getty...
923a60
Mar 13 04:50:45 11bf07f59fff systemd[1]: Starting Console Getty...
923a60
923a60
(cherry picked from commit 1b41981d9a62443d566df6bcabc1b5024e9f5e4a)
923a60
923a60
Cherry-picked from: 77d83ce
923a60
Resolves: #1222517
923a60
---
923a60
 units/console-getty.service.m4.in | 1 +
923a60
 1 file changed, 1 insertion(+)
923a60
923a60
diff --git a/units/console-getty.service.m4.in b/units/console-getty.service.m4.in
923a60
index 8ac51a471b..413d94094b 100644
923a60
--- a/units/console-getty.service.m4.in
923a60
+++ b/units/console-getty.service.m4.in
923a60
@@ -9,6 +9,7 @@
923a60
 Description=Console Getty
923a60
 Documentation=man:agetty(8)
923a60
 After=systemd-user-sessions.service plymouth-quit-wait.service
923a60
+ConditionPathExists=/dev/console
923a60
 m4_ifdef(`HAVE_SYSV_COMPAT',
923a60
 After=rc-local.service
923a60
 )m4_dnl