View previous topic :: View next topic |
Author |
Message |
ShallowCorporateRaider Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/gallery/Simpsons/simpsons_groundskeeper_will.gif)
Joined: 11 Dec 2003 Posts: 83 Location: Knoxville, TN
|
Posted: Mon Feb 09, 2004 1:24 am Post subject: Dell Latitude D600 and ACPI |
|
|
I have a new Dell D600, which I only recently finished setting up Gentoo on. Currently, I have almost everything working, and I hope I am on the home stretch. I have never installed Linux of any flavor on a laptop before (although I have put Gentoo on my desktop and my server) and I do not even know where to begin to get ACPI to work on this thing.
I am using mm-sources (2.6.2-rc2-mm1) and I have all the ACPI options compiled into the kernel. I have acpid installed and running on boot. I looked at this excellent thread https://forums.gentoo.org/viewtopic.php?t=80077, and I have created the scripts as outlined there.
My problem is that when I close the lid, or press the power button, or do anything else that generates an ACPI event, nothing happens. Well, let me clarify that -- the event is logged. When I do a
it shows the events, and it says that it is executing the action in the correct file, but nothing happens. So, for example, when I close the lid, nothing happens, but I see this in the log:
Code: | [Sun Feb 8 19:56:01 2004] received event "button/lid LID 00000080 00000007"
[Sun Feb 8 19:56:01 2004] executing action "/etc/acpi/default.sh button/lid LID 00000080 0000000
7"
[Sun Feb 8 19:56:01 2004] BEGIN HANDLER MESSAGES
[Sun Feb 8 19:56:01 2004] END HANDLER MESSAGES
[Sun Feb 8 19:56:01 2004] action exited with status 0
[Sun Feb 8 19:56:01 2004] executing action "/etc/acpi/action.sh button/lid LID 00000080 00000007
"
[Sun Feb 8 19:56:01 2004] BEGIN HANDLER MESSAGES
[Sun Feb 8 19:56:01 2004] END HANDLER MESSAGES
[Sun Feb 8 19:56:01 2004] action exited with status 0
[Sun Feb 8 19:56:01 2004] completed event "button/lid LID 00000080 00000007" |
Could someone point me in the right direction? _________________ The thing I hate about an argument is that it always interrupts a discussion. -- G. K. Chesterton |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
jetblack Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/357474726400fdeb311e49.jpg)
Joined: 15 Jan 2003 Posts: 340 Location: Evanston, IL, USA
|
Posted: Mon Feb 09, 2004 1:31 am Post subject: |
|
|
Could be a syntax error in your acpi scripts. You may want to put some debugging messages in there to make sure the scripts aren't aborting. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
ShallowCorporateRaider Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/gallery/Simpsons/simpsons_groundskeeper_will.gif)
Joined: 11 Dec 2003 Posts: 83 Location: Knoxville, TN
|
Posted: Mon Feb 09, 2004 1:01 pm Post subject: |
|
|
jetblack,
Thanks for replying so quickly. Now, to be quite honest, I don't know very much about scripting at all, so bear with me here. I am trying to get just one or two ACPI events working at a time, and the two I wanted to get working first are the lid and power button events. Here is the relevant part of the script I'm using (it is actually Friday's script from the post I linked above):
Code: | # powerbutton pressed
# if kde is running try to show dialog - else shutdown immediately
btn_pwr ()
{
$LOGGER "Powerbutton pressed"
if test -f $KDEDIR/bin/dcop && $KDEDIR/bin/dcop kdesktop > /dev/null 2>&1
then
$LOGGER "KDE running: asking user what to do"
dcop --all-sessions ksmserver ksmserver logout 1 2 0 && exit 0
else
$LOGGER "shutdown initiated"
/sbin/init 0
fi
}
# lid closed/opened
# Anything useful to do when lid is closed/opened?
btn_lid ()
{
if grep -q open $LID_STATE
then
$LOGGER "Lid opened"
else
$LOGGER "Lid closed"
fi
}
# let's see which event occured and what action to take :-)
# have a look at /var/log/acpid to see what your events look like
# and adjust accordingly
case "$*" in
ac_adapter\ ACAD\ 00000080\ 00000000)
acad_out
;;
ac_adapter\ ACAD\ 00000080\ 00000001)
acad_in
;;
battery\ BAT1\ 00000080\ 00000001)
battery
;;
button?lid\ LID\ 00000080\ ????????)
# the last eight digits count the times the lid was shut
btn_lid
;;
button?power\ PWRF\ 00000080\ ????????)
# the last eight digits count the times the button was pressed
btn_pwr
;;
*)
no_action
;;
esac |
This script catches the event, logs it, and then defines an action for it , right? Is the problem simply that there are no actions defined for the btn_lid and btn_pwr events? What could I find a list of usable commands for ACPI events?
Again, I apologize for my utter ignorance of this subject. _________________ The thing I hate about an argument is that it always interrupts a discussion. -- G. K. Chesterton |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
trapperjohn Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/gallery/Monkey Island/Monkey_Island_-_Monkey.gif)
Joined: 11 Nov 2003 Posts: 242 Location: Bremen/Germany
|
Posted: Mon Feb 09, 2004 1:51 pm Post subject: |
|
|
ShallowCorporateRaider wrote: |
This script catches the event, logs it, and then defines an action for it , right? Is the problem simply that there are no actions defined for the btn_lid and btn_pwr events? |
The script catches the event, and the case-statement decides, what to do with it. In you example: if it's "button?lid\ LID\ 00000080\ ????????" then the function btn_lid will be called. And btn_lid just logs the event - so there's nothing wrong with this script. It just doesn't do anything else than logging.
I have not (yet) found a versatile and always-working script, which does a good ACPI-event-handling. For example, suspend-to-ram would be the best choice for lid-closing. But most Laptops have still problems with it - so the script would just freeze the laptop, when the lid is closed.
Maybe it could execute "xset dpms force off" when the lid is closed, but your XServer needs access from local users, so you have to enable it by "xhost + localhost" when you log into X. And its not very powersaving. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
jetblack Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/357474726400fdeb311e49.jpg)
Joined: 15 Jan 2003 Posts: 340 Location: Evanston, IL, USA
|
Posted: Mon Feb 09, 2004 1:58 pm Post subject: |
|
|
ShallowCorporateRaider wrote: | jetblack,
Thanks for replying so quickly. Now, to be quite honest, I don't know very much about scripting at all, so bear with me here. I am trying to get just one or two ACPI events working at a time, and the two I wanted to get working first are the lid and power button events. Here is the relevant part of the script I'm using (it is actually Friday's script from the post I linked above):
... sciprt here ...
This script catches the event, logs it, and then defines an action for it , right? Is the problem simply that there are no actions defined for the btn_lid and btn_pwr events? What could I find a list of usable commands for ACPI events?
Again, I apologize for my utter ignorance of this subject. |
Don't worry about the fact that you haven't done a lot of scripting. We all have to start somewhere
I don't think that the problem is that the events aren't defined. "btn_power" and "btn_lid" are the names of the routines that you have defined in this script. Since the routines exist, they should be getting called. You should be seeing the messages in /var/log/messages. If you're not, try for a really minimal version of the script. You may just want to back up your existing copy and replace it with a one-liner. Something like this:
Code: | #!/bin/sh
logger "Hooray! I was called!" |
If it doesn't even execute that, then there's a problem with the configuration somewhere. If you do get that message, then you can add routines back in one at a time. That will make it easier to track problems if there are any. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|