Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I was wondering why power events does not work as expected when I'm using virtual console (or whatever the thing that appears after Ctrl-Alt-F1 is called).

I've set my laptop to go to sleep when lid is closed and it is working fine when I'm in graphical interface. But when I switch to virtual console, closed lid just turns the screen off.

How it is possible, I thought such low level stuff is controlled by daemons and they do not depend on the type of interface I'm in?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

You'll find the answer in /etc/acpi/lid.sh. You are correct that there is an ACPI daemon that responds to things like closing the lid. However, if you look at the line near the top of the script:

if [ `CheckPolicy` = 0 ]; then exit; fi

you'll see a line that cancels the whole thing. The CheckPolicy thing checks whether something like Gnome Power Manager is running on the current console. If so, it aborts, and lets the power manager handle it.

So, when GNOME is the active session, Gnome Power Manager handles the lid. When the console is the active session, the ACPI daemon handles the lid. If you read the rest of the lid.sh script, you'll see that all it does is blank the screen.

share|improve this answer

Probably related to consolekit. Consolekit tracks who is logged in and where to deal with multiuser systems. Logging into the vt getty probably doesn’t register with consolekit. You can check with ck-list-sessions. G-p-m asks CK just the same as pulseaudio does. When you switch to a vt then audio cuts out.

share|improve this answer
    
On my system the audio doesn't cut out when I switch to a vt. Ubuntu Lucid. –  Li Lo Aug 7 '10 at 13:03
    
Looks like it does register, it shows a new session after login into vt. –  vava Aug 10 '10 at 6:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.