Comment 7 for bug 1006676

Revision history for this message
Pablo Hörtner (redtux2000) wrote :

Hi there,

I also just had the same problem on an Ubuntu 16.04.3 LTS box (with both zsh and bash, on tty and on pseudo terminal running X). Is it already known where this error message comes from, so we could change the string to something more convenient recommending the user to become root or to run sudo?

Of course, as explained by ESR it would be nice if it was not even necessary to run the command as root, but (at least on my system) normal users have no permission to access the respective file descriptors.

ls -l /dev/console
crw------- 1 root root 5, 1 Aug 22 11:13 /dev/console

ls -l /dev/tty0
crw--w---- 1 root tty 4, 0 Aug 22 11:13 /dev/tty0

strace tells me that showkey (run as user) does not have enough privileges:
open("/dev/tty0", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/tty0", O_WRONLY) = -1 EACCES (Permission denied)
open("/dev/tty0", O_RDONLY) = -1 EACCES (Permission denied)
open("/dev/console", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/console", O_WRONLY) = -1 EACCES (Permission denied)
open("/dev/console", O_RDONLY) = -1 EACCES (Permission denied)

BTW: I am running the most recent kbd/showkey version that is available for Xenial. Maybe this bug has already been fixed upstream in version 2.0?

apt-cache policy kbd
kbd:
  Installed: 1.15.5-1ubuntu5
  Candidate: 1.15.5-1ubuntu5
  Version table:
 *** 1.15.5-1ubuntu5 500
        500 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1.15.5-1ubuntu4 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages