Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localectl does not respect libxkbcommon search paths #29178

Closed
cmeissner opened this issue Sep 13, 2023 · 2 comments
Closed

localectl does not respect libxkbcommon search paths #29178

cmeissner opened this issue Sep 13, 2023 · 2 comments
Labels
bug 🐛 Programming errors, that need preferential fixing locale not-supported

Comments

@cmeissner
Copy link

systemd version the issue has been seen with

253

Used distribution

Fedora 38

Linux kernel version used

6.4.14-200.fc38.x86_64

CPU architectures issue was seen on

None

Component

other

Expected behaviour you didn't see

localectl should always try to read all available config paths for xkb

Unexpected behaviour you saw

localctl only reads /usr/share/X11/xkb/rules/base.lst:

$ strace -e trace=openat localectl list-x11-keymap-layouts 1>/dev/null                       
openat(AT_FDCWD, "/usr/lib64/systemd/glibc-hwcaps/x86-64-v3/libsystemd-shared-253.9-1.fc38.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/systemd/glibc-hwcaps/x86-64-v2/libsystemd-shared-253.9-1.fc38.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/systemd/libsystemd-shared-253.9-1.fc38.so", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib64/systemd/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib64/systemd/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libacl.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libblkid.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libcap.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libcrypt.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libkmod.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/liblz4.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libmount.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libcrypto.so.3", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libpam.so.0", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libseccomp.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/liblzma.so.5", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libzstd.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libattr.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libaudit.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libeconf.so.0", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libpcre2-8.so.0", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libcap-ng.so.0", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/proc/sys/kernel/cap_last_cap", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/share/X11/xkb/rules/base.lst", O_RDONLY|O_CLOEXEC) = 4

Steps to reproduce the problem

reproduce with custom config file

  1. create a base.lst in $XDG_CONFIG_HOME/xkb/rules/, or $HOME/.config/xkb/rules/ with the following content:
    ! layout
      foobar     A description for the foobar layout
    
    !include %S/base.lst
    
  2. run localectl list-x11-keymap-layouts | grep foobar
  3. you can run the command with strace -e trace=openat to see that the user configuration is not opened.

reproduce with distributed config files

  1. add the following line to /usr/share/X11/xkb/rules/base.lst in layout section
       foobar     A description for the foobar layout
    
  2. run localectl list-x11-keymap-layouts | grep foobar you should find your defined layout

Additional program output to the terminal or log subsystem illustrating the issue

No response

@cmeissner cmeissner added the bug 🐛 Programming errors, that need preferential fixing label Sep 13, 2023
@yuwata yuwata added the locale label Sep 13, 2023
@poettering
Copy link
Member

sorry, but this is not going to work, as localed/localectl manage the system keyboard mappins, and hence local settings are simply not available.

@cmeissner
Copy link
Author

I do agree with per user keyboard layouts but what about custom layouts defined in /etc/xkb|? These are machine global and per your argument candidates for localectl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Programming errors, that need preferential fixing locale not-supported
Development

No branches or pull requests

3 participants