Linux - Laptop and NetbookHaving a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).
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.
Ok, got some interesting things to report on this post.
First off, to answer your question, yes the /proc/acpi/button/lid/LID/state is reporting the correct state of the lid button.
After I added the set -x and set +x to lidbtn.sh and ran it, the following was displayed:
Code:
[robert@localhost ~]$ su
Password:
[root@localhost robert]# cd /etc/acpi
[root@localhost acpi]# ./lidbtn.sh
++ cat /proc/acpi/button/lid/LID/state
++ awk '{print $2}'
+ state=open
+ logger $'\342i' 'LID state open'
+ '[' open = closed ']'
+ /usr/sbin/radeontool light on
+ set +x
[root@localhost acpi]#
Now comes the strange part. I
When I pressed down on the lid button, and ran the script again, the screen shut off. When I released the lid button, nothing happened. In order for me to turn the screen on (without restarting) I typed ./lidbtn.sh, hit enter, and the screen turned on again.
Thinking that maybe the lid was not pressing down on the lid button when it was closed, I attached a USB keyboard to the laptop and closed the lid. The screen stayed on until I typed ./lidbtn.sh, then it shut off. When I opened the lid, again, it did not turn on so I just ran the script again.
I hope i explained everything clearly. if not, just let me know.
By the way, thanks for helping with this problem again.
Second, Is the file /etc/acpi/events/lidbtn owned by root/root?
There is one other place to look for output about what is going on. The logger bit in the lidbtn.sh script writes to the system log. But there should be a acpid log in /var/log. Check there to see what it is saying everytime the button is pushed. Mine says this with the set -x stuff in there:
[Fri Aug 26 10:29:02 2005] starting up
[Fri Aug 26 10:29:02 2005] 2 rules loaded
[Fri Aug 26 10:38:35 2005] exiting
[Fri Aug 26 10:49:45 2005] starting up
[Fri Aug 26 10:49:45 2005] 2 rules loaded
[Fri Aug 26 10:53:21 2005] received event "button/lid LID 00000080 00000001"
[Fri Aug 26 10:53:21 2005] executing action "/etc/acpi/lidbtn.sh"
[Fri Aug 26 10:53:21 2005] BEGIN HANDLER MESSAGES
++ cat /proc/acpi/button/lid/LID/state
++ awk '{print $2}'
+ state=closed
+ logger -i 'LID state closed'
+ '[' closed = closed ']'
+ /usr/sbin/radeontool light off
+ set +x
[Fri Aug 26 10:53:21 2005] END HANDLER MESSAGES
[Fri Aug 26 10:53:21 2005] action exited with status 0
[Fri Aug 26 10:53:21 2005] completed event "button/lid LID 00000080 00000001"
[Fri Aug 26 10:53:24 2005] received event "button/lid LID 00000080 00000002"
[Fri Aug 26 10:53:24 2005] executing action "/etc/acpi/lidbtn.sh"
[Fri Aug 26 10:53:24 2005] BEGIN HANDLER MESSAGES
++ cat /proc/acpi/button/lid/LID/state
++ awk '{print $2}'
+ state=open
+ logger -i 'LID state open'
+ '[' open = closed ']'
+ /usr/sbin/radeontool light on
+ set +x
[Fri Aug 26 10:53:24 2005] END HANDLER MESSAGES
[Fri Aug 26 10:53:24 2005] action exited with status 0
[Fri Aug 26 10:53:24 2005] completed event "button/lid LID 00000080 00000002"
[Fri Aug 26 11:01:29 2005] exiting
The only thing I can think of is that this event is not being seen by acpid. I would check ownership.
I was looking around and some peoples event lines differ. The acpid site says to enter is like it says in the acpid log. So maybe try and change it to:
event=button/lid
or
event=button/lid*
While checking the log file /var/log/acpid, I found something that I think may be causing the problem. Here is a bit of the log:
[Fri Aug 26 17:09:08 2005] action exited with status 0
[Fri Aug 26 17:09:08 2005] completed event "button/lid LID 00000080 00000001"
[Fri Aug 26 17:09:11 2005] received event "button/lid LID 00000080 00000002"
[Fri Aug 26 17:09:11 2005] notifying client 2678[0:0]
[Fri Aug 26 17:09:11 2005] executing action "/etc/acpi/lidbtn.sh"
[Fri Aug 26 17:09:11 2005] BEGIN HANDLER MESSAGES
++ cat /proc/acpi/button/lid/LID/state
++ awk '{print $2}'
+ state=open
+ logger $'\342i' 'LID state open'
+ '[' open = closed ']'
+ /usr/sbin/radeontool light on Radeon hardware not found in lspci output.
+ set +x
[Fri Aug 26 17:09:11 2005] END HANDLER MESSAGES
The part I put in bold is the part that I found interesting. What could this mean? I checked the hardware browser in Gnome (since I'm not sure how to view that information in the command line) and under video cards, it has listed ATI Technologies Inc RV350 [Mobility Radeon 9600 M10].
That is very confusing. It works fine if you run the script separately. I don't know what could be causing your problem. To list that stuff as is said just type lspci in a console. Something weird is happening.
I am curious to find out what this is referring to.
[Fri Aug 26 17:09:11 2005] notifying client 2678[0:0]
Distribution: Distribution: RHEL 5 with Pieces of this and that.
Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700
Rep:
Just to make sure here is the state for the lid changing from open to close to open?
To me it sounds like there is only one input detected but something down the line in acpi is not resetting. I have a similiar issue. I detect the lid button but it never changes state. It always says open. So I ended up creating three scripts to do this the fisrt is the main script that is either has the contents of the last two. What it does is flip flop back and forth.
Started school this week and the past couple of days have been hectic. Thats reason I have not posted back for awhile.
Anyway, heres what I've done since my last post. I performed a clean install of Fedora, created the two scrpits, lidbtn and lidbtn.sh and installed radeontool. Still no luck with the screen shutting off. I rechecked the log and this what it said;
Code:
[Wed Aug 31 17:42:23 2005] starting up
[Wed Aug 31 17:42:23 2005] 1 rule loaded
[Wed Aug 31 18:00:04 2005] client connected from 2842[0:0]
[Wed Aug 31 18:00:04 2005] 1 client rule loaded
[Wed Aug 31 18:08:16 2005] exiting
[Wed Aug 31 18:08:16 2005] starting up
[Wed Aug 31 18:08:16 2005] 2 rules loaded
[Wed Aug 31 18:08:18 2005] received event "button/lid LID 00000080 00000001"
[Wed Aug 31 18:08:18 2005] executing action "/etc/acpi/lidbtn.sh"
[Wed Aug 31 18:08:18 2005] BEGIN HANDLER MESSAGES
Radeon hardware not found in lspci output.
[Wed Aug 31 18:08:18 2005] END HANDLER MESSAGES
[Wed Aug 31 18:08:18 2005] action exited with status 255
[Wed Aug 31 18:08:18 2005] completed event "button/lid LID 00000080 00000001"
[Wed Aug 31 18:08:20 2005] received event "button/lid LID 00000080 00000002"
[Wed Aug 31 18:08:20 2005] executing action "/etc/acpi/lidbtn.sh"
[Wed Aug 31 18:08:20 2005] BEGIN HANDLER MESSAGES
Radeon hardware not found in lspci output.
[Wed Aug 31 18:08:20 2005] END HANDLER MESSAGES
[Wed Aug 31 18:08:20 2005] action exited with status 255
[Wed Aug 31 18:08:20 2005] completed event "button/lid LID 00000080 00000002"
[Wed Aug 31 18:08:23 2005] received event "button/lid LID 00000080 00000003"
[Wed Aug 31 18:08:23 2005] executing action "/etc/acpi/lidbtn.sh"
[Wed Aug 31 18:08:23 2005] BEGIN HANDLER MESSAGES
Radeon hardware not found in lspci output.
[Wed Aug 31 18:08:23 2005] END HANDLER MESSAGES
[Wed Aug 31 18:08:23 2005] action exited with status 255
[Wed Aug 31 18:08:23 2005] completed event "button/lid LID 00000080 00000003"
[Wed Aug 31 18:08:23 2005] received event "button/lid LID 00000080 00000004"
[Wed Aug 31 18:08:23 2005] executing action "/etc/acpi/lidbtn.sh"
[Wed Aug 31 18:08:23 2005] BEGIN HANDLER MESSAGES
Radeon hardware not found in lspci output.
[Wed Aug 31 18:08:23 2005] END HANDLER MESSAGES
[Wed Aug 31 18:08:23 2005] action exited with status 255
[Wed Aug 31 18:08:23 2005] completed event "button/lid LID 00000080 00000004"
[Wed Aug 31 18:12:24 2005] exiting
[Wed Aug 31 18:12:24 2005] starting up
[Wed Aug 31 18:12:24 2005] 1 rule loaded
[Wed Aug 31 18:12:26 2005] received event "button/lid LID 00000080 00000005"
[Wed Aug 31 18:12:26 2005] completed event "button/lid LID 00000080 00000005"
[Wed Aug 31 18:12:30 2005] received event "button/lid LID 00000080 00000006"
[Wed Aug 31 18:12:30 2005] completed event "button/lid LID 00000080 00000006"
[Wed Aug 31 18:16:21 2005] exiting
[Wed Aug 31 18:17:49 2005] starting up
[Wed Aug 31 18:17:49 2005] 2 rules loaded
[Wed Aug 31 18:17:54 2005] client connected from 2577[0:0]
[Wed Aug 31 18:17:54 2005] 1 client rule loaded
[Wed Aug 31 18:27:20 2005] received event "button/lid LID 00000080 00000001"
[Wed Aug 31 18:27:20 2005] notifying client 2577[0:0]
[Wed Aug 31 18:27:20 2005] executing action "/etc/acpi/lidbtn.sh"
[Wed Aug 31 18:27:20 2005] BEGIN HANDLER MESSAGES
Radeon hardware not found in lspci output.
[Wed Aug 31 18:27:20 2005] END HANDLER MESSAGES
[Wed Aug 31 18:27:20 2005] action exited with status 255
[Wed Aug 31 18:27:20 2005] completed event "button/lid LID 00000080 00000001"
[Wed Aug 31 18:27:20 2005] received event "button/lid LID 00000080 00000002"
[Wed Aug 31 18:27:20 2005] notifying client 2577[0:0]
[Wed Aug 31 18:27:20 2005] executing action "/etc/acpi/lidbtn.sh"
[Wed Aug 31 18:27:20 2005] BEGIN HANDLER MESSAGES
Radeon hardware not found in lspci output.
[Wed Aug 31 18:27:20 2005] END HANDLER MESSAGES
[Wed Aug 31 18:27:20 2005] action exited with status 255
[Wed Aug 31 18:27:20 2005] completed event "button/lid LID 00000080 00000002"
It still says "Radeon hardware not found in lspci output." and the thing TFMegatron pointed out "Notifying Client."
I checked lspci and the following entry was there:
I am going to try installing the ATI driver for my Radeon video card sometime soon and see what happens. Hopefully that will correct the problem (keeping fingures crossed) and as far as the notifiying client thing, I will have to look into that as well.
Brian1: Yes the lid is changing from open to close.
From: Matthew Saltzman <mjs ces clemson edu>
To: For users of Fedora Core releases <fedora-list redhat com>
Subject: Re: Some things that used to work in FC3 but don't in FC4: ACPI
Date: Wed, 29 Jun 2005 09:43:47 -0400 (EDT)
The ACPI scripts for my Thinkpad don't work as they used to. For example, the script I use to turn off the backlight touches or removes a file to indicate whether the backlight is on or off. In FC4, the script is apparently not allowed to touch the file in either /etc/acpi/actions (where it used to) or even in /var/tmp (where I changed it to).
Also, radeontool appears to fail to detect the Radeon in lspci when run form the script, but it works fine when run from the command line as root.
The error is different from the one that usually occurs when running radeontool as non-root, which is "can't open /dev/mem Are you root?"
This error is "Radeon hardware not found in lspci output."
This issue also affects my suspend script, which is not permitted to write to /proc/acpi/sleep.
Any ideas what's going on here?
To follow myself up:
As I kind of suspected, this is an SELinux issue--turn off enforcing mode and everything works as expected. So how can I give these scripts access to the files they need to touch/write to?
Thanks.
--
Matthew Saltzman
Did more looking around on SELinux enforcing mode.
Quote:
Q: How do I temporarily turn off enforcing mode without having to reboot?
A: This situation usually arises when you can't perform an action that is being prevented by policy. Run the command setenforce 0 to turn off enforcing mode in real time. When you are finished, run setenforce 1 to turn enforcing back on.
sysadm_r role required
You must issue the setenforce command with the sysadm_r role; to do so, use the newrole command. Alternately, if you switch to root using su -, you gain the sysadm_r role automatically.
Q: How do I turn system-call auditing on/off at boot?
A: Add audit=1 to your kernel command line to turn system-call auditing on. Add audit=0 to your kernel command line to turn system-call auditing off.
System-call auditing is off by default. When on, it provides information about the system-call that was executing when SELinux generated a denied message. This may be helpful when debugging policy.
I am sure it wouldn't be very secure but I suppose you could add this to the top and bottom of the lidbtn.sh script to take care of the auditing problem.
setenforce 0
setenforce 1
I would check into this as well. I am not familiar with FC so I don't know what this SELinux is, but the problem seems to be inline with yours. So I am not much help. Sorry
Good luck.
Quote:
Q: How do I get status info about my SELinux installation?
A: As root, execute the command /usr/sbin/sestatus -v. For more information, refer to the sestatus(8) manual page.
Actually, TFMegatron, you were a BIG help once again. I played around with SELinux and checked a couple Fedora forums and it appears that others are having similar probelms and this is the suggested solution.
Now the LCD screen shuts off like it's suppose to.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.