Bug 920648
| Summary: | Why is agetty spawned automatically on hvc0 | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Lukáš Doktor <ldoktor> |
| Component: | systemd | Assignee: | systemd-maint |
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 18 | CC: | johannbg, lnykryn, metherid, mschmidt, msekleta, notting, plautrba, systemd-maint, vpavlin, zbyszek |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-04-09 11:08:59 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Lukáš Doktor
2013-03-12 13:38:07 UTC
Because it's defined as a virtual console device, it's treated in the same category as the console ttys - instead of requiring specific configuration, configure it in the absence of any other configuration. Oh that's why. The thing that bugs me is that only hvc0 is hardcoded there. It doesn't spawn tty on hvc1 hvc2, ... Also the behaviour is new. RHEL5/6 does nothing and you have to modify rc.local in order to get mingetty on hvc*. Currently I solved my problem by masking the hvc0 service. But in case I should need tty on hvc I'd have to unmask and start the service. Or is there another way? Disabling of this service doesn't help as it's marked as 'want' during boot. The automatic getty happens always only at the *first* device:
static const char virtualization_consoles[] =
"hvc0\0"
"xvc0\0"
"hvsi0\0";
This Lennart's blog post explains what happens: http://0pointer.de/blog/projects/serial-console.html Perhaps it does not sufficiently explain *why* spawning getty on the first VM console should be the right thing to do. And apparently the behavior is surprising to some. Hm, I could have sworn we did this out of the box in the pre-systemd days as well, but I could be wrong. Yes, we did that in Upstart days too. I don't think so. I'm using virtual RHEL6 which doesn't spawn anything by default (well it spawns tty2-6 and that's all). (tested today with RHEL6.3, kernel-2.6.32-279.el6 initscripts-9.03.31-2.el6) But anyway, is this really something to change? I mean, we start gettys on VCs too automatically, so it sounds like the right thing to treat hvcs the same? It's certainly a good idea to give the admin some way to enter his machine if SSH is down... I have to insist that this is inconsistent, duplicitous and from my point of view bad behavior. And I can explain why: From what I know about consoles they are either specified on the boot line (console=ttyS1 console=hvc0) or there is a default console (on x86 vt/tty). I find out that Xen kernels usually need to use hvc instead of tty since they might/usually use dummy device for vt. But they do that by changing the preferred console in kernel ( https://lkml.org/lkml/2008/4/10/209 ). The beauty of systemd is that it detects the consoles from /sys/class/tty/console/active and automatically spawns the tty on the last one. (thanks for that, guys) Since Xen kernel registers hvc as preferred console, systemd should spawn the console because of this (if not override on the boot line) and not because it's named hvc0. KVM machines usually have a valid tty so hvc is not (currently) registered as preferred console thus (IMO) tty shouldn't be spawned if not set explicitly on the boot line or by enabling of the service by sysadmin. I haven't tried the Xen kernel, but I played with KVM. When I specify on boot line console=hvc1 as last console, systemd spawned tty as expected. Also it spawned another console on hvc0 because it's hard-coded. Still it didn't spawn any console on hvc2 which was also present but is not specified on the boot line nor hard-coded in systemd. |