Re: Probs with Kbd Layout, sudo and kpowersave !!

2006-11-18 Thread Kevin Williams

Any ideas or suggestions, how I can get my keyboard working ? It's
nothing to the hardware itself as the kbd works just perfect while in
SuSE and winxp.

Another interesting observation - when I browse using konqueror, the
minus sign shows up as a strange box shaped character !!

Thanks for any responses.

Kevin

On 11/15/06, Kevin Williams [EMAIL PROTECTED] wrote:


Thanks very much the responses.

Soon after I sent email to the list, I embarked on the task of
troubleshooting these pesky lil' probs.

The problem with sudo, Dan, like you said had to do with /etc/sudoers ! I
tried moving /etc/pam.d/sudo out of the way and this gave me a pam realted
error when I tried to sudo. I tried different CL args to sudo for eg. sudo
-H -u root sh -c ls ~ as root gave me an error that User rooot doesn't
have permission to run /bin/sh ls ~ as user kevin !!  This forced me look
into /etc/sudoers. It contained the line root ALL = (ALL) ALL yet, that
didn't seem to work ! I commented out all lines except the ones related to
the permissions to root and underprivileged user. Sudo worked ! Then, I
uncommented all lines one by one trying to sudo after every edit. After
having uncommented all lines thus, bringing it back to its original state,
sudo still worked ! To put it bluntly, I don't know how or why ? Maybe, an
unprintable char or I don't know. visudo never complained about the syntax.
Well, the good this is sudo is working.

About the kpowersave problem, an hour's search on the internet over how to
configure powersave with dbus returned nothing appropriate. I revisited BLFS
Book and read thru' the DBUS and HAL notes. Thats when I noticed the link to
hints which you have pointed out in your email. Acting on the instructions I
installed pam_console and created the scripts to get KDM launch a user dbus
session. When, I had it all ready, upon entering the password on the login
screen it kept dropping me back to the login screen. Obviously because, the
script that would launch the user's dbus session was calling sudo to achieve
it and sudo wasn't working for me ! I tried launching dbus session from
within kde and that didn't make it work for some strange reason. Maybe,
because kde does some sort of initialization and dbus must be launched prior
to that !   When I log  into kde as root, kpowersave works without a glitch.

I decided to strace kpowersave and did just that. Output of 'strace
kpowersave' showed the various libs it was accessing and then the
/etc/sudoers followed by the error message. That made me think that,
kpowersave is using sudo to achieve its job done. Now that I've sudo working
kpowersave is working just perfect !!

Finally, the keyboard, sorry, I missed that console script. Though, I walked
thru' every init script I installed and modified where ever I felt like, I
think I overlooked that one. So stupid of me !  I am a bit mused over the
location of kbd directory ! I ran a find under /usr and when I didn't find
it I simply copied it from suse ! Now, after you have told me that it is
indeed there under /lib/kbd !! Well, I've just created
/etc/sysconfig/console. I rebooted hoping everything is gonna work just
perfect ! Disappointment awaited me as I still have the problem with
Xtrl+Alt+Fn combination !

I have tried booting into SuSE, dumping the kbd map to a file using dumpkeys
and trying to load that map in BLFS. Nope, that doesn't seem to get it
working. Now, I wonder, what other tricks do I have to try to get the damed
thing working !? Here's what /etc/sysconfig/console contains:

KEYMAP=us
FONT=iso01.16 -m 8859-1


I'm not using any KEYMAP_CORRECTIONS. I wonder if that is the key to it !
Shouldn't be  ?! Its a qwerty kbd and I think the above settings should have
made it behave the right way.

Thanks very much again for the help. I would appreciate if I could be led in
the right direction to solve this darned kbd issue.

Kevin



On 11/15/06, Dan Nicholson [EMAIL PROTECTED] wrote:
 On 11/14/06, Kevin Williams [EMAIL PROTECTED] wrote:
 
  Soon after booting into runlevel 5 (KDE) I noticed that, the kbd
shortcuts
  Ctrl+Alt+Fn to switch between the vt's don't work ! Back in the red hat
 days
  I knew how to do this, now I just don't remember !! :-(   I chose
keyboard
  layout in KControl and that solved the problem of Ctrl+Alt+Fn.
  Unfortunately, this seems to work as long as I'm logged into KDE.

 Somethings wrong with your keyboard setup. Ctrl+Alt+Fn is not a KDE
 thing. It should works at the console or in X or wherever.

  I've tried to look into SuSE (occasionallt I keep booting into SuSE to
see
  how SuSE achieves things which, helps me to troubleshoot whenever I've
 probs
  in BLFS) and found that SuSE uses different approach. SuSE seems to be
 using
  keymap files stored under /usr/share/kbd. I don't find this folder in
 BLFS.
  Maybe, it has to do with the difference between XORG-7 and XORG-6.9.
I've
  XORG-7 installed in BLFS.

 If 

Re: Probs with Kbd Layout, sudo and kpowersave !!

2006-11-18 Thread Dan Nicholson

On 11/15/06, Kevin Williams [EMAIL PROTECTED] wrote:


About the kpowersave problem, an hour's search on the internet over how to 
configure powersave with dbus returned nothing appropriate. I revisited BLFS 
Book and read thru' the DBUS and HAL notes. Thats when I noticed the link to 
hints which you have pointed out in your email. Acting on the instructions I 
installed pam_console and created the scripts to get KDM launch a user dbus 
session. When, I had it all ready, upon entering the password on the login 
screen it kept dropping me back to the login screen. Obviously because, the 
script that would launch the user's dbus session was calling sudo to achieve it 
and sudo wasn't working for me ! I tried launching dbus session from within kde 
and that didn't make it work for some strange reason. Maybe, because kde does 
some sort of initialization and dbus must be launched prior to that !   When I 
log  into kde as root, kpowersave works without a glitch.


I'm confused. Why are you launching dbus with sudo? There should be no
need to do that. The whole point of the hal configuration that I
pointed out is that there is configuration in the hal.conf file that
allows certain users to gain privileges without needing root rights.
This can be done by using pam_console, but it's not trivial. Make sure
you follow all the wiki pages so you get it enabled in your session
properly. Or, just add another user group and give them prvileges like
it explains in the book.

As far as kde initializing dbus, it's really easy to find out whether
a session bus has been started already. Is DBUS_SESSION_BUS_ADDRESS
set?


I decided to strace kpowersave and did just that. Output of 'strace kpowersave' 
showed the various libs it was accessing and then the /etc/sudoers followed by 
the error message. That made me think that, kpowersave is using sudo to achieve 
its job done. Now that I've sudo working kpowersave is working just perfect !!


That sounds really strange. I have no idea why sudo would be needed.

--
Dan
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page


Re: Probs with Kbd Layout, sudo and kpowersave !!

2006-11-18 Thread Shawn

Kevin:

Good your sudo works now. To bad we don't know why.

My /etc/sysconfig/console looks like this

KEYMAP=us
FONT=lat1-16 -m 8859-1

Did you review the section in the lfs book about configuring the linux 
console?


Ok, here are some ideas for d-bus/hal debugging.

D-Bus requires 2 sessions. First, a system session. Second, a user 
session. The system session is started at boot time. The user session is 
started either when you login or when you startx.


If you use a login manager, then you need to start the d-bus user 
session in /etc/profile. google for dbus-launch to learn how to set this 
up. I believe there is a dbus hint that will explain this.


If you don't use a login manager, the easiest way to start the user 
session is to wrap dbus around your desktop session. Modify ~/.xinitrc 
as follows:

dbus-launch startkde --exit-with-session

To ensure things are well with dbus, enter 'dbus-launch' at a console. 
Two values should be returned.


To help diagnose possible hal problems, you can add two options to the 
loadproc command in /etc/rc.d/init.d/haldaemon:

--verbose=yes --use-syslog

Then restart hald.

In your syslog you should see many, many messages about hal discovering 
devices. If you don't see any messages after doing this, then you don't 
have hal running correctly. Put a cd in your cd drive and hald will show 
this event in the syslog.


One other idea, do you notice any dbus/hal problems running as root?


Shawn
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page


Re: Probs with Kbd Layout, sudo and kpowersave !!

2006-11-18 Thread Dan Nicholson

On 11/17/06, Kevin Williams [EMAIL PROTECTED] wrote:

Any ideas or suggestions, how I can get my keyboard working ? It's
nothing to the hardware itself as the kbd works just perfect while in
SuSE and winxp.

Another interesting observation - when I browse using konqueror, the
minus sign shows up as a strange box shaped character !!


Kevin, please don't top-post and try to trim down the replies to just
what's relevant. Thanks.

There could be any number of problems here. At a very basic level,
make sure that your shell isn't messing up your keys. Check that
/etc/inputrc is as it's given in the LFS book or isn't broken in some
other way:

http://lfs.osuosl.org/lfs/view/development/chapter07/inputrc.html

Next, when you're in an X session, /etc/sysconfig/console doesn't
matter. What's the output from setxkbmap -print?

Finally, for konqueror, we should make sure that the fonts are working
from Fontconfig. I don't know what the default setup is, but
presumably the font is generic Sans. In that case, what's the output
for fc-match Sans?

Oh yeah. What locale are you using? LC_ALL? LANG?

--
Dan
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page


Re: Probs with Kbd Layout, sudo and kpowersave !!

2006-11-15 Thread Dan Nicholson

On 11/14/06, Kevin Williams [EMAIL PROTECTED] wrote:


Soon after booting into runlevel 5 (KDE) I noticed that, the kbd shortcuts
Ctrl+Alt+Fn to switch between the vt's don't work ! Back in the red hat days
I knew how to do this, now I just don't remember !! :-(   I chose keyboard
layout in KControl and that solved the problem of Ctrl+Alt+Fn.
Unfortunately, this seems to work as long as I'm logged into KDE.


Somethings wrong with your keyboard setup. Ctrl+Alt+Fn is not a KDE
thing. It should works at the console or in X or wherever.


I've tried to look into SuSE (occasionallt I keep booting into SuSE to see
how SuSE achieves things which, helps me to troubleshoot whenever I've probs
in BLFS) and found that SuSE uses different approach. SuSE seems to be using
keymap files stored under /usr/share/kbd. I don't find this folder in BLFS.
Maybe, it has to do with the difference between XORG-7 and XORG-6.9. I've
XORG-7 installed in BLFS.


If you have a newer LFS, they are in /lib/kbd. X uses an entirely
different setup, but I'd try to get things working at the console
before complicating things with X.


Secondly, I can't sudo ! Sudo asks for root users password and typing the
right password doesn't let me in. Displays a message 'Sorry, try again' !
After three tries it just goes away with a message '3 incorrect password
attempts' ! I've installed Kerberos5, heimdal, Linux-PAM with Cracklib
support (Uh ! Overkill !). This is what I find in my /etc/pam.d/sudo file:


I don't think the pam configuration is the issue. Two things. What are
the permissions of sudo? It needs to be suid as far as I can tell,
just like su:

[12:08 PM [EMAIL PROTECTED] ls -l /usr/bin/sudo
---s--x--x 2 root root 91232 2006-05-23 15:39 /usr/bin/sudo

Second, look in /var/log/auth.log for some clues about what's
happening in the authentication process.

And, yes, you have a ton of overkill there. Especially with kerberos,
which is completely non-trivial. Not that your asking, but it would be
a much better plan to build these things gradually. Also, I think it's
conflicting to have both Krb5 and heimdal.


Finally, I've problems with kpowersave. I've acpid and powersave (the latest
version) installed to support kpowersave. acpid config files are empty to
make it forward the events to powersave. Powersaved seems to be running
fine. When I boot into KDE, kpowersave displays a messagebox saying 'You are
not permitted to connect to the powersave daemon via DBUS. Please check your
DBUS configuration and installtion' !!


Are you running a dbus session daemon? You'd probably see something
like dbus-launch in ps, but I don't know how KDE sets this up.

I don't get any powersave/scheme

option in kpowersave menu save the help menu !!  I've compared the settings
in SuSE and BLFS including the file permissions and found them to be the
same. kpowersave works in SuSE while it displays the before mentioned error
message. I guess, it has to with the DBUS policy. These are the messages
from powersaved I found in the logs:
-
daemon.log:Nov 14 02:30:38 kevkim powersaved[15074]: WARNING
(filter_function:208) Hal service stopped. Battery information no longer
available
daemon.log:Nov 14 02:30:39 kevkim powersaved[15074]: ERROR
(filter_function:97) DBus daemon disconnected. Trying to reconnect...


Is Hal running? Obviously, kpowersaved isn't going to do squat if it
can't get any info from Hal.


I've compared files under  /etc/dbus/, /etc/acpid and /etc/powersave and
also the files in /etc/sysconfig and found them to be same as those in SuSE.
Diff returned nothing ! Yet, I don't understand why it works in SuSE and not
in BLFS.


That explains one thing. Unless you have pam_console going, you're
going to need to give unprivileged users permission to use the Hal
methods. See here:

http://lfs.osuosl.org/blfs/view/svn/general/hal.html#hal-config

Good luck.

--
Dan
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page


Re: Probs with Kbd Layout, sudo and kpowersave !!

2006-11-15 Thread Kevin Williams


Thanks very much the responses.

Soon after I sent email to the list, I embarked on the task of troubleshooting these pesky lil' probs. 


The problem with sudo, Dan, like you said had to do with /etc/sudoers ! I tried moving /etc/pam.d/sudo out of 
the way and this gave me a pam realted error when I tried to sudo. I tried different CL args to sudo for eg. 
sudo -H -u root sh -c ls ~ as root gave me an error that User rooot doesn't have permission 
to run /bin/sh ls ~ as user kevin !!  This forced me look into /etc/sudoers. It contained the line 
root ALL = (ALL) ALL yet, that didn't seem to work ! I commented out all lines except the ones 
related to the permissions to root and underprivileged user. Sudo worked ! Then, I uncommented all lines one 
by one trying to sudo after every edit. After having uncommented all lines thus, bringing it back to its 
original state, sudo still worked ! To put it bluntly, I don't know how or why ? Maybe, an unprintable char 
or I don't know. visudo never complained about the syntax. Well, the good this is sudo is working.

About the kpowersave problem, an hour's search on the internet over how to 
configure powersave with dbus returned nothing appropriate. I revisited BLFS 
Book and read thru' the DBUS and HAL notes. Thats when I noticed the link to 
hints which you have pointed out in your email. Acting on the instructions I 
installed pam_console and created the scripts to get KDM launch a user dbus 
session. When, I had it all ready, upon entering the password on the login 
screen it kept dropping me back to the login screen. Obviously because, the 
script that would launch the user's dbus session was calling sudo to achieve it 
and sudo wasn't working for me ! I tried launching dbus session from within kde 
and that didn't make it work for some strange reason. Maybe, because kde does 
some sort of initialization and dbus must be launched prior to that !   When I 
log  into kde as root, kpowersave works without a glitch.

I decided to strace kpowersave and did just that. Output of 'strace kpowersave' showed the various libs it was accessing and then the /etc/sudoers followed by the error message. That made me think that, kpowersave is using sudo to achieve its job done. Now that I've sudo working kpowersave is working just perfect !! 


Finally, the keyboard, sorry, I missed that console script. Though, I walked 
thru' every init script I installed and modified where ever I felt like, I 
think I overlooked that one. So stupid of me !  I am a bit mused over the 
location of kbd directory ! I ran a find under /usr and when I didn't find it I 
simply copied it from suse ! Now, after you have told me that it is indeed 
there under /lib/kbd !! Well, I've just created /etc/sysconfig/console. I 
rebooted hoping everything is gonna work just perfect ! Disappointment awaited 
me as I still have the problem with Xtrl+Alt+Fn combination !

I have tried booting into SuSE, dumping the kbd map to a file using dumpkeys 
and trying to load that map in BLFS. Nope, that doesn't seem to get it working. 
Now, I wonder, what other tricks do I have to try to get the damed thing 
working !? Here's what /etc/sysconfig/console contains:

KEYMAP=us
FONT=iso01.16 -m 8859-1


I'm not using any KEYMAP_CORRECTIONS. I wonder if that is the key to it ! Shouldn't be  ?! Its a qwerty kbd and I think the above settings should have made it behave the right way. 


Thanks very much again for the help. I would appreciate if I could be led in 
the right direction to solve this darned kbd issue.

Kevin



On 11/15/06, Dan Nicholson [EMAIL PROTECTED] wrote:

On 11/14/06, Kevin Williams [EMAIL PROTECTED] wrote:

 Soon after booting into runlevel 5 (KDE) I noticed that, the kbd shortcuts
 Ctrl+Alt+Fn to switch between the vt's don't work ! Back in the red hat
days
 I knew how to do this, now I just don't remember !! :-(   I chose keyboard
 layout in KControl and that solved the problem of Ctrl+Alt+Fn.
 Unfortunately, this seems to work as long as I'm logged into KDE.

Somethings wrong with your keyboard setup. Ctrl+Alt+Fn is not a KDE
thing. It should works at the console or in X or wherever.

 I've tried to look into SuSE (occasionallt I keep booting into SuSE to see
 how SuSE achieves things which, helps me to troubleshoot whenever I've
probs
 in BLFS) and found that SuSE uses different approach. SuSE seems to be
using
 keymap files stored under /usr/share/kbd. I don't find this folder in
BLFS.
 Maybe, it has to do with the difference between XORG-7 and XORG-6.9. I've
 XORG-7 installed in BLFS.

If you have a newer LFS, they are in /lib/kbd. X uses an entirely
different setup, but I'd try to get things working at the console
before complicating things with X.

 Secondly, I can't sudo ! Sudo asks for root users password and typing the
 right password doesn't let me in. Displays a message 'Sorry, try again' !
 After three tries it just goes away