Bug 1001411 - systemd-vconsole-setup fails to set the keymap correctly [NEEDINFO]
systemd-vconsole-setup fails to set the keymap correctly
Status: CLOSED INSUFFICIENT_DATA
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
rawhide
All Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
: Reopened
: 963202 975238 983758 1000786 1014310 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-26 22:34 EDT by poma
Modified: 2014-02-02 20:26 EST (History)
19 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-02-02 20:26:03 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
lpoetter: needinfo? (hhoyer)


Attachments (Terms of Use)
Attachment described briefly. (1.63 KB, patch)
2013-10-04 21:22 EDT, poma
no flags Details | Diff
As usual, attachment described briefly. (798 bytes, patch)
2013-10-07 23:11 EDT, poma
no flags Details | Diff

  None (edit)
Description poma 2013-08-26 22:34:39 EDT
Remove 'vconsole.keymap=<keymap>' from the boot loader's kernel 'append' line, and let the 'systemd-vconsole-setup.service' manage the system locale and keyboard layout settings.
.krow t'nseoD
The only solution is to "systemctl restart systemd-vconsole-setup.service".
This is the x86_64.
On i686 it's OK.
Welcome to Paradise.
Comment 1 poma 2013-09-18 13:43:12 EDT
I'll partially correct myself.
This doesn't work for i686, either.
And this is 'the' how it works,

/etc/systemd/system/actual-vconsole-setup-start.service
# Actual Virtual Console Setup Start

[Unit]
Description=Actual Virtual Console Setup Start

[Service]
Type=forking
ExecStart=/usr/lib/systemd/systemd-vconsole-setup

[Install]
WantedBy=rescue.target multi-user.target
EOF

Enabled SELinux isn't an issue,
sestatus 
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

To recap, "localectl set-keymap <KEYMAP>" does work, however after reboot settings aren't applied cause of non functional 'systemd-vconsole-setup.service'.

I leave to the respected reader to contemplate. :)

p.s.
All these reports seem like the same problem:
https://bugzilla.redhat.com/show_bug.cgi?id=1000786
https://bugzilla.redhat.com/show_bug.cgi?id=983758
https://bugzilla.redhat.com/show_bug.cgi?id=975238
https://bugzilla.redhat.com/show_bug.cgi?id=963202
Comment 2 poma 2013-09-18 14:02:43 EDT
Tested with:
- systemd-204-11.fc19.x86_64
- systemd-207-2.fc21.x86_64
- systemd-204-11.fc19.i686
- systemd-207-2.fc21.i686

p.s.
Don't forget to "systemctl enable actual-vconsole-setup-start.service" before reboot. :)
Comment 3 Adam Williamson 2013-09-18 22:48:54 EDT
"p.s.
All these reports seem like the same problem:"

then maybe close your bug as a dupe of one of them? :)
Comment 4 poma 2013-09-19 06:11:53 EDT
> then maybe close your bug as a dupe of one of them? :)

Meanwhile versions have changed, so the details aren't identical.
That's why I prefer to leave it to the maintainer to decide.
Yabba dabba doo! :)
Comment 5 Lennart Poettering 2013-09-29 14:05:27 EDT
*** Bug 1000786 has been marked as a duplicate of this bug. ***
Comment 6 Lennart Poettering 2013-09-29 14:07:54 EDT
Hmm, if you run /usr/lib/systemd/systemd-vconsole-setup manually from a console shell, do things work then?
Comment 7 Lennart Poettering 2013-09-29 14:08:37 EDT
*** Bug 975238 has been marked as a duplicate of this bug. ***
Comment 8 Lennart Poettering 2013-09-29 14:09:52 EDT
*** Bug 963202 has been marked as a duplicate of this bug. ***
Comment 9 Lennart Poettering 2013-09-29 14:14:11 EDT
Also, if this happens, what's the precise contents of /proc/cmdline?

(background: the kernel command line setting always overrides system config, hence you can use localectl as many times as you wish to set the locale settings, as long as something is specified in /proc/cmdline to override it it is ignored...)
Comment 10 Lennart Poettering 2013-09-29 14:16:43 EDT
Also, I have the vague suspicion that systemd-vconsole-setup is invoked only in the initrd where some keymaps/fonts might be missing and then not refreshed in the real system...
Comment 11 Lennart Poettering 2013-09-29 14:17:01 EDT
*** Bug 983758 has been marked as a duplicate of this bug. ***
Comment 12 Adam Williamson 2013-10-01 03:34:41 EDT
Lennart: from my somewhat, ahem, less cryptic 'dupe' report:

"If you run 'systemctl restart systemd-vconsole-setup.service' , the correct keymap is loaded."
Comment 13 drago01 2013-10-01 03:53:16 EDT
(In reply to Adam Williamson from comment #12)
> Lennart: from my somewhat, ahem, less cryptic 'dupe' report:
> 
> "If you run 'systemctl restart systemd-vconsole-setup.service' , the correct
> keymap is loaded."

This confirms what said in comment 10 (i.e it is run to early). 

Lennart is there a way to specify that a service should run *after* switching to the real root?
Comment 14 Adam Williamson 2013-10-01 16:06:21 EDT
*** Bug 1014310 has been marked as a duplicate of this bug. ***
Comment 15 poma 2013-10-02 04:24:15 EDT
(In reply to Lennart Poettering from comment #6)
> Hmm, if you run /usr/lib/systemd/systemd-vconsole-setup manually from a
> console shell, do things work then?

Through the "localectl" or directly in this way, both works.
However point of this story is to engage locale settings after reboot.
Comment 16 poma 2013-10-02 04:45:18 EDT
(In reply to Lennart Poettering from comment #9)
> Also, if this happens, what's the precise contents of /proc/cmdline?
> 
> (background: the kernel command line setting always overrides system config,
> hence you can use localectl as many times as you wish to set the locale
> settings, as long as something is specified in /proc/cmdline to override it
> it is ignored...)

We know this already, and not just from the "man 5 locale.conf", 
"… Note that the kernel command line options locale.… may be used to override the locale settings at boot. …" :)

$ cat /proc/cmdline 
root=UUID=cc995be2-84dd-4a7e-ad2e-2b5ce3ae58eb  initrd=/initramfs-3.12.0-0.rc3.git0.1.fc21.i686+PAE.img BOOT_IMAGE=/vmlinuz-3.12.0-0.rc3.git0.1.fc21.i686+PAE

$ cat /boot/extlinux/extlinux.conf
ui menu.c32
menu title Fedora 21 Boot Options.
timeout 50

label Fedora (3.12.0-0.rc3.git0.1.fc21.i686+PAE) 21 (Rawhide)
	kernel /vmlinuz-3.12.0-0.rc3.git0.1.fc21.i686+PAE
	append root=UUID=cc995be2-84dd-4a7e-ad2e-2b5ce3ae58eb 
	initrd /initramfs-3.12.0-0.rc3.git0.1.fc21.i686+PAE.img
…

The very essence of this endeavor is to relieve the kernel command line, i.e. not to lock the settings within.
Comment 17 poma 2013-10-02 05:00:41 EDT
(In reply to Lennart Poettering from comment #10)
> Also, I have the vague suspicion that systemd-vconsole-setup is invoked only
> in the initrd where some keymaps/fonts might be missing and then not
> refreshed in the real system...

Dunno is it related, 

$ cat /etc/dracut.conf.d/omit-i18n-dracut-module.conf 
# dracut modules to omit
omit_dracutmodules+=" i18n "

# dracut -v -N -f
Executing: /sbin/dracut -v -N -f
dracut module 'i18n' will not be installed, because it's in the list to be omitted!
…

also has no effect on the outcome.
Comment 18 Adam Williamson 2013-10-02 08:24:21 EDT
I think we're pretty clear on what's going on here now (per c#13), but just for the record, I happened to spot this while going through journalctl for unrelated reasons this morning:

Oct 02 13:39:56 vaioz.happyassassin.net systemd[1]: Starting Local File Systems.
Oct 02 13:39:56 vaioz.happyassassin.net systemd[1]: Reached target Local File Systems.
Oct 02 13:39:56 vaioz.happyassassin.net systemd[1]: Started Create list of required static device nodes for the current kernel.
Oct 02 13:39:56 vaioz.happyassassin.net systemd[1]: Starting Create static device nodes in /dev...
Oct 02 13:39:56 vaioz.happyassassin.net dracut-cmdline[97]: dracut-20 (Heisenbug) dracut-033-3.git20130913.fc20
Oct 02 13:39:56 vaioz.happyassassin.net systemd-vconsole-setup[101]: Cannot open font file True
Oct 02 13:39:56 vaioz.happyassassin.net systemd[1]: Started Create static device nodes in /dev.
Oct 02 13:39:56 vaioz.happyassassin.net systemd-vconsole-setup[101]: /usr/bin/setfont failed with error code 66.
Oct 02 13:39:56 vaioz.happyassassin.net systemd[1]: Started Setup Virtual Console.
Oct 02 13:39:56 vaioz.happyassassin.net systemd[1]: Started dracut cmdline hook.
Oct 02 13:39:56 vaioz.happyassassin.net systemd[1]: Starting dracut pre-udev hook...
Oct 02 13:39:56 vaioz.happyassassin.net systemd[1]: Started dracut pre-udev hook.
Oct 02 13:39:56 vaioz.happyassassin.net systemd[1]: Starting udev Kernel Device Manager...

You can indeed see that a) it's getting started very early (I think we are in dracut, there) and b) it's failing.
Comment 19 Marko Myllynen 2013-10-02 10:00:40 EDT
>> Also, if this happens, what's the precise contents of /proc/cmdline?
>> 
>> (background: the kernel command line setting always overrides system config,
>> hence you can use localectl as many times as you wish to set the locale
>> settings, as long as something is specified in /proc/cmdline to override it
>> it is ignored...)
> 
> Oct 02 13:39:56 vaioz.happyassassin.net systemd-vconsole-setup[101]: Cannot
> open font file True
> Oct 02 13:39:56 vaioz.happyassassin.net systemd-vconsole-setup[101]: 
> /usr/bin/setfont failed with error code 66.

FWIW, I installed F20 using the default English (US) for language and Finnish for keyboard, then after booting I only changed LANG in /etc/locale.conf from en_US.UTF-8 to es_ES.utf8 and now after rebooting I have:

/proc/cmdline:
... vconsole.font=latarcyrheb-sun16 vconsole.keymap=fi-latin1 LANG=en_US.UTF-8 ...

initramfs/etc/locale.conf:
LC_ALL="C"
LANG="en_US.UTF-8"

initramfs/etc/vconsole.conf:
KEYMAP="fi-latin1"
UNICODE="1"
FONT="latarcyrheb-sun16"

/etc/locale.conf:
LANG=es_ES.utf8

/etc/vconsole.conf:
KEYMAP="fi-latin1"
FONT="latarcyrheb-sun16"

The end result at console being US keymap in use and Spanish used as language but no above errors in logs - initramfs contains /usr/lib/kbd/consolefonts/latarcyrheb-sun16.psfu and /usr/lib/kbd/keymaps/legacy/i386/qwerty/fi-latin1.map (but note that "loadkeys fi-latin1" on console uses /lib/kbd/keymaps/i386/qwerty/fi-latin1.map.gz).
Comment 20 Lennart Poettering 2013-10-02 10:22:33 EDT
hmm, so Harald, what's the plan here? If vconsole-setup is run in dracut we probably should also include the fonts and things in dracut. Or if it is run in the host OS, then dracut shouldn't run it?
Comment 21 poma 2013-10-04 01:26:33 EDT
Y'all pulled a good conclusion.
This one IS related, and the problem is solved within,

/etc/dracut.conf.d/omit_dracut-module-systemd.conf 
# dracut modules to omit
omit_dracutmodules+=" systemd "

# dracut -v -f
Executing: /sbin/dracut -v -f
dracut module 'systemd' will not be installed, because it's in the list to be omitted!
…

Tested with:
systemd-208-1.fc21.x86_64/i686
dracut-033-3.git20130913.fc21.x86_64/i686
Comment 22 poma 2013-10-04 21:22:04 EDT
Created attachment 807992 [details]
Attachment described briefly.
Comment 24 poma 2013-10-07 23:11:33 EDT
Created attachment 809056 [details]
As usual, attachment described briefly.
Comment 25 poma 2013-10-07 23:13:20 EDT
- F18 doesn't have this problem
- F19/20/21 after applying 'gtf2oh' patch, vconsole-setup.servo is reborn.
Comment 26 poma 2013-10-07 23:18:17 EDT
Feel free to reopen.
Godspeed.
Comment 27 Adam Williamson 2013-10-08 15:12:20 EDT
Why are you closing this if you had to apply a patch to fix it? It'll still be broken for anyone who doesn't manually apply a patch.
Comment 28 Adel Gadllah 2013-10-08 15:17:56 EDT
(In reply to poma from comment #26)
> Feel free to reopen.
> Godspeed.

WTF?
Comment 29 Harald Hoyer 2013-10-15 05:19:45 EDT
(In reply to poma from comment #23)
> I think this commit is causing all the trouble.
> http://cgit.freedesktop.org/plymouth/commit/scripts/plymouth-populate-initrd.
> in?id=8be792a5a7914f742f188493df37c0e967f8e847

Well, this turns off plymouth in the initramfs.

It would show that, if plymouth is running, systemd-vconsole-setup can't set anything, because plymouth is keeping the terminal busy.
Comment 30 Marko Myllynen 2013-10-22 03:11:32 EDT
Fedora 20 Alpha installed yesterday and updated today (incl. kernel) seems to work fine for me now.
Comment 31 Christian Stadelmann 2013-10-25 07:33:17 EDT
Running Fedora 20 Alpha (fedup from F19 ~5 days ago; updated today) on 2 machines. In both cases this bug is still present.

On one machine:
$ localectl 
   System Locale: LANG=de_DE.UTF-8
       VC Keymap: de-neo
      X11 Layout: de,de,us
     X11 Variant: neo,,
     X11 Options: grp:sclk_toggle

on the other one:
$ localectl 
   System Locale: LANG=de_DE.UTF-8
       VC Keymap: de-neo
      X11 Layout: de,de,us
     X11 Variant: neo,,

in both cases:
$ cat /etc/vconsole.conf 
KEYMAP="de-neo"
FONT="latarcyrheb-sun16"

even adding "vconsole.keymap=de-neo" to kernel cmdline does not change the keyboard layout. Only workaround is using the default (de) layout for cryptsetup password prompt and tty login and then running
$ loadkeys de-neo
which works fine.
There are no log entries related to 'vconsole', 'de-neo', 'kbd', 'xkb' or 'keyboard'.
Comment 32 Adam Williamson 2013-10-25 13:05:55 EDT
It's always going to happen with the Alpha package set, but as of Beta it may be fixed; at least, doing a clean install with Beta TC5 using a non-US layout to enter an encryption password, the correct non-US layout is used to decrypt the partition at boot time.
Comment 33 MERCIER Jonathan 2013-10-28 19:13:46 EDT
from F20 i think i have same problem
I have a bépo kyboard then i do:
- localectl set-locale LANG=fr_FR.utf
- localectl set-keymap --no-convert fr-bepo

#  cat /etc/vconsole.conf
KEYMAP=fr-bepo
FONT=lat9-16

my gnome environnement and terminal works fine with my bépo keyboard but not for tty

tty load a qwerty keymap

I see this error message

#  journalctl -b | grep loadkey
oct. 28 23:33:21 localhost.localdomain systemd-vconsole-setup[125]: /usr/bin/loadkeys failed with error code 1.

any help to fix it are welcome
Comment 34 Christian Stadelmann 2013-10-31 04:45:25 EDT
@Adam Williamson: You are right, works fine for me now.
At every stage from boot (asking for HDD pw; ttys at login; ttys after login (default); gdm; …) the keyboard layout is now set correctly on F20. Adding vconsole.keymap to kernel cmdline overrides this behavior as expected.

@MERCIER Jonathan:
What does running
$ loadkeys fr-bepo
do? Seems like systemd-vconsole-setup failed to execute that program.
Comment 35 poma 2014-02-02 09:00:24 EST
(In reply to Harald Hoyer from comment #29)
> (In reply to poma from comment #23)
> > I think this commit is causing all the trouble.
> > http://cgit.freedesktop.org/plymouth/commit/scripts/plymouth-populate-initrd.
> > in?id=8be792a5a7914f742f188493df37c0e967f8e847
> 
> Well, this turns off plymouth in the initramfs.
> 
> It would show that, if plymouth is running, systemd-vconsole-setup can't set
> anything, because plymouth is keeping the terminal busy.

Round and around and around and around we go
Oh now, tell me now, tell me now, tell me now you know.

Ooh, ooh, ooh, the reason I hold on
Ooh, ooh, ooh, 'cause I need this hole gone
Funny you're the broken one but I'm the only one who needed saving
'Cause when you never see the light it's hard to know which one of us is caving.
Comment 36 Adam Williamson 2014-02-02 11:53:37 EST
poma: can you please stop posting stuff like that? I've been holding off from asking you since I figured you might work it out yourself, but it's not cute and it's not clever and it's not helping anyone. This is a bug tracker, a place where we come to fix bugs. If what you're posting is not helping to fix a bug, please leave it out.

This applies to devel@ and so on as well. These little gnomic things you post are just distracting and polluting the discussion spaces. I don't mean to be mean, but please, can you just keep it to productive stuff? Thanks.
Comment 37 poma 2014-02-02 20:16:46 EST
How do I remove my bugzilla.redhat account?

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