Bug 64658
Summary: | kbdrate doesn't work when run inside apmcontinue | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | dellaric |
Component: | kbd | Assignee: | Eido Inoue <havill> |
Status: | CLOSED RAWHIDE | QA Contact: | David Lawrence <dkl> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.3 | CC: | debian |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | 1.12-1 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2004-02-27 01:41:53 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
dellaric
2002-05-09 08:32:41 UTC
Looking at /etc/init.d/keytable, I've seen this line: loadkeys $KEYTABLE < /dev/tty0 > /dev/null 2>&1 I've modified my /etc/sysconfig/apm-scripts/apmcontinue to use kbdrate -d 250 -r 30 < /dev/tty0 instead of the old kbdrate -d 250 -r 30 and now kbdrate works correctly. I can reproduce this problem from the command line with bash -c 'kbdrate&' IMO, kbdrate shouldn't require a terminal to work properly. Also, in 7.3 running kbdrate from a console always sets the repeat rate to 33.3cps, delay 250ms, regardless of the arguments I specify. Running it from an xterm works fine. I'm not using RedHat but Debian instead. Nevertheless, on Debian exists the same problem. I changed the source of kbdrate to fix it, here is a patch for kbdrate.c: --- ../kbdrate/kbd-1.06/src/kbdrate.c.orig 2003-09-27 01:24:20.000000000 +0200 +++ ../kbdrate/kbd-1.06/src/kbdrate.c 2003-09-27 01:19:29.000000000 +0200 @@ -105,7 +105,7 @@ kbdrep_s.rate = -1; kbdrep_s.delay = -1; if (ioctl( 0, KDKBDREP, &kbdrep_s )) { - if (errno == EINVAL) + if ((errno == EINVAL) || (errno == ENOTTY)) return 0; perror( "ioctl(KDKBDREP)" ); exit( 1 ); As you can see, kbdrate crashes if no tty is available, but there is no reason for it. Just catching this error works fine (at least for me) Hope that helps patch to output to stderr rather than crash and output to messages log is in kbd 1.12 |