Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You need to provide much more information for someone to be able to help you
Please tell the members what Linux server OS you are running, what version, and on what hardware. And, what would be the default keymap you expect to be loaded?
Plus, an exact copy of the text of the error message(s) would be very helpful.
The above link outlines the `loadkeys` command, which apparently loads the keymap you choose.
Now, I don't use RHEL, so I can't point you to exactly where this action takes place during boot, but I suspect it would be done in one of the init scripts located somewhere like /etc/rc.d or /etc/init.d or similar location.
Verify that the keymap you wish to load is actually present where it should be, and/or use the -d option to specify the default keymap, assuming en_us is the default and that is what you wish to use.
I'm sorry if this isn't enough info to point you in the right direction, but another member with RHEL experience will hopefully be able to fill in the blanks for you in time.
thanks
I know the command "loadkeys -d" can load default keymap.
but i dont know why the error as metioned before occoured (loading default keymap [failured])
when booting.
i checked the inital file which located in /etc/rc.d/rc.sysinit but I cant find the error.
part of rc.sysinit are as below:
----------------------------------------
# Configure kernel parameters
update_boot_stage RCkernelparam
sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1
if [ -x /bin/loadkeys ]; then
KEYTABLE=
KEYMAP=
if [ -f /etc/sysconfig/console/default.kmap ]; then
KEYMAP=/etc/sysconfig/console/default.kmap
else
if [ -f /etc/sysconfig/keyboard ];then
. /etc/sysconfig/keyboard
fi
if [ -n "$KEYTABLE" -a -d "/lib/kbd/keymaps" ];then
Ok, first, let me suggest you put such chunks of code into [code] tags, so it makes it a little easier to read.
Now, It looks like you're looking into the right place, to start figuring out WHY you're getting the error. Let's break down what's happening in that file, and I would like YOU to verify that each step is true for your system. For example, if the script is checking to see if a file exists somewhere, then YOU should go on your system and make sure the file does exist. Follow this pseudocode:
Code:
Checks if /bin/loadkeys is executable. If it IS executable, then define a couple variables..
KEYTABLE=
KEYMAP=
..and check if there's a file called /etc/sysconfig/console/default.kmap and if there is, set KEYMAP=that file..
KEYMAP=/etc/sysconfig/console/default.kmap
..if there's no such file, see if there's a file called /etc/sysconfig/keyboard and if there is,
then include that file into here.
Now, if $KEYTABLE is not an empty variable at this point, AND
there's a directory called /lib/kbd/keymaps THEN set KEYMAP="$KEYTABLE.map"
Now, if $KEYMAP is not an empty variable, THEN
if $KEYTABLE is not an empty variable, THEN
tell the user $"Loading default keymap ($KEYTABLE): "
otherwise, $KEYTABLE IS empty variable, so tell the user echo -n $"Loading default keymap: " instead.
define LOADKEYS=loadkeys #this is poor coding -- it should be LOADKEYS=/bin/loadkeys
check if LANG equals some incarnation of "utf8", and if so..
then LOADKEYS="loadkeys -u" # again, this should be "/bin/loadkeys -u" in my opinion.
Now, we're executing the loadkeys command, because theoretically at this point, our variables are set to something useful:
$LOADKEYS $KEYMAP < /dev/tty0 > /dev/tty0 2>/dev/null && \
success $"Loading default keymap" || failure $"Loading default keymap" # it looks like this line is what puts the error
message on your screen, which means that
evidently, something was NOT set
to something useful as it should be.
endif
endif
So, you must follow each step of the code, and check that what the code is doing, is producing the result that it should be. The error message is telling you that something's gone wrong finding the default keymap.
You have the 'loadkeys' executable, so that's fine. However:
If you do not have the file "default.kmap" and you do not have the file "/etc/sysconfig/keyboard", OR either of those files is empty or misconfigured, then things go downhill from there, likely leading to the error.
Try adding some `echo` statements to this script, to check each stage of the process.
For example, after the line:
KEYMAP=/etc/sysconfig/console/default.kmap
put something like:
echo $KEYMAP
exit 1
to see what $KEYMAP equals.
Do that until you determine where the trouble is being created.
You appear to have already determined at least *part* of the problem: you say that default.kmap does not exist, and /etc/sysconfig/keyboard does not exist either. My suggestion is to make it so that one of these exists, and try again.
As to how to get the stuff you need, into these locations, I suggest check the documentation for the OS, use Google, or search the RedHat or Enterprise forums here on LQ, to see what's supposed to be there.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.