RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1201682 - When /dev/console does not exist like in a container, running console-getty.service just causes endless error in the log
Summary: When /dev/console does not exist like in a container, running console-getty.s...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd-container
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Lukáš Nykrýn
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1302191
TreeView+ depends on / blocked
 
Reported: 2015-03-13 09:15 UTC by Jan Pazdziora
Modified: 2016-01-27 11:01 UTC (History)
4 users (show)

Fixed In Version: systemd-container-208.20-5.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-01-27 11:01:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jan Pazdziora 2015-03-13 09:15:07 UTC
Description of problem:

Create minimal image which runs systemd(-container) based on rhel7.1, using Dockerfile

   FROM rhel7.1
   RUN yum install -y /usr/bin/ps
   ENV container docker
   CMD [ "/usr/sbin/init" ]

When you run the container without -t, the process

   /sbin/agetty --noclear --keep-baud console 115200 38400 9600

is not happy and checking the journal in the container, there is a stream of

Mar 13 04:50:15 11bf07f59fff agetty[66]: /dev/console: No such file or directory
Mar 13 04:50:25 11bf07f59fff systemd[1]: console-getty.service holdoff time over, scheduling restart.
Mar 13 04:50:25 11bf07f59fff systemd[1]: Stopping Console Getty...
Mar 13 04:50:25 11bf07f59fff systemd[1]: Starting Console Getty...
Mar 13 04:50:25 11bf07f59fff systemd[1]: Started Console Getty.
Mar 13 04:50:25 11bf07f59fff agetty[67]: /dev/console: No such file or directory
Mar 13 04:50:35 11bf07f59fff systemd[1]: console-getty.service holdoff time over, scheduling restart.
Mar 13 04:50:35 11bf07f59fff systemd[1]: Stopping Console Getty...
Mar 13 04:50:35 11bf07f59fff systemd[1]: Starting Console Getty...
Mar 13 04:50:35 11bf07f59fff systemd[1]: Started Console Getty.
Mar 13 04:50:35 11bf07f59fff agetty[74]: /dev/console: No such file or directory
Mar 13 04:50:45 11bf07f59fff systemd[1]: console-getty.service holdoff time over, scheduling restart.
Mar 13 04:50:45 11bf07f59fff systemd[1]: Stopping Console Getty...
Mar 13 04:50:45 11bf07f59fff systemd[1]: Starting Console Getty...

Version-Release number of selected component (if applicable):

package systemd is not installed
systemd-container-208.20-4.el7.x86_64

How reproducible:

Deterministic.

Steps to Reproduce:
1. Build image based on the above Dockerfile.
2. Run container using

docker run -v /sys/fs/cgroup:/sys/fs/cgroup:ro agetty-issue

3. Check processes and journal, using

   docker exec <the-container-id> ps axuwwf
   docker exec <the-container-id> journalctl

Actual results:

/sbin/agetty running and restarted every minut.

Expected results:

/sbin/agetty not running.

Additional info:

Comment 1 Jan Pazdziora 2015-03-13 09:15:45 UTC
I proposed the following patch:

--- a/console-getty.service	2015-03-13 05:02:40.895716807 -0400
+++ b/console-getty.service	2015-03-13 05:06:54.067478792 -0400
@@ -11,6 +11,7 @@
 After=systemd-user-sessions.service plymouth-quit-wait.service
 After=rc-local.service
 Before=getty.target
+ConditionPathExists=/dev/console
 
 [Service]
 ExecStart=-/sbin/agetty --noclear --keep-baud console 115200,38400,9600 $TERM

Comment 3 Lukáš Nykrýn 2015-03-13 10:43:37 UTC
Hmm /dev/cosnole is mentioned in our 
http://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/
as one of the interfaces that should be present.
Can I ask you to send this patch to our upstream mailing list?
Meanwhile I would be open to apply it in systemd-container since we already have there some downstream workarounds.

Comment 4 Jan Pazdziora 2015-03-13 10:47:33 UTC
(In reply to Lukáš Nykrýn from comment #3)
> Hmm /dev/cosnole is mentioned in our 
> http://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/
> as one of the interfaces that should be present.

However, it is not if you have -t (and rightly so, I'd say):

# docker run rhel7.1 ls -la /dev/console
ls: cannot access /dev/console: No such file or directory
# docker run -t rhel7.1 ls -la /dev/console
crw-------. 1 root root 136, 2 Mar 13 06:46 /dev/console
#

> Can I ask you to send this patch to our upstream mailing list?

I'd prefer you took it from here. I'm not subscribed there.

Comment 5 Lukáš Nykrýn 2015-03-13 11:53:18 UTC
> I'd prefer you took it from here. I'm not subscribed there.

Ok, will do.

Comment 6 Lukáš Nykrýn 2015-03-17 13:17:10 UTC
Your patch is now in upstream
http://cgit.freedesktop.org/systemd/systemd/commit/?id=1b41981d9a62443d566df6bcabc1b5024e9f5e4a

devel_ack for backport

Comment 7 Lukáš Nykrýn 2016-01-27 11:01:54 UTC
This is fixed in 7.2 by introducing the regular systemd-219


Note You need to log in before you can comment on or make changes to this bug.