# kde 4.4 laptop logout when lid close [SOLVED]

## reup

hello all,

I have a laptop with kde 4.4.4 (just upgraded) installed, but since my first install of kde on this laptop, the session will logoff if I close the lid

this is really annoying as my cat has the bad habit of sitting on the laptop during the night and the only way to continue my download at night is to keep the session active with the lid closed

I use powerdevil as kde power management

cpugreq is installed, acpid as well as laptop_mode

another example of this curious behavior is if I press the power-off button, my kde setup is to show the logout/shutdown menu. I get that, but the laptop turn itself off immediately after that, going through the normal gentoo shutdown procedure

I arrive at the conclusion that I have 2 power management system interfering with each other. one is powerdevil from kde, the other.... I dont know

any clue ??

reup

----------

## Hu

In its default configuration, acpid listens for power button events and will halt the system when the power button is pressed.

----------

## reup

so if I stop the deamon acpid (/etc/init.d/acpid stop) I should give back control to powerdevil, exact ? 

I will test that right away

----------

## reup

I stop acpid then closed the lid of the laptop. 

I had to reboot the computer as when I open the lid, I end up with a black screen and a square blinking in the middle. now way to go back to any console or screen

I will try to locate the config files from acpid and see if I can modify them to stop login off on close lid

----------

## kukibl

Check /etc/acpi/events/ and /etc/acpi/actions/ for acpid configuration files. As far as I understand, acpid's event actions are in coorelation with laptop-mode, so it is quite possible that your problems are caused by laptop-mode configuration (/etc/laptop-mode/laptop-mode.conf).

The last problem you described (when you had to restart) seems to me as suspend-to-RAM (stand by) gone wrong, so make sure you have correct settings/default actions in your Powerdevil configuration.

----------

## reup

Kukibl,

thanks for the info

below is the relevant laptop_mod config. as you can see, LID_CLOSED is on 0 and disable on AC, so it should not interfere with powerdevil

```
#

# Enable laptop mode when on AC power.

#

ENABLE_LAPTOP_MODE_ON_AC=0

#

# Enable laptop mode when the laptop's lid is closed, even when we're on AC

# power? (ACPI-ONLY)

#

ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED=0

```

powerdevil is set to profile performance and this profile specify to do nothing if lid closed, so it should not go to "suspend to RAM"

----------

## cach0rr0

your cat is clearly defective. I think this is the core of the problem. 

No feline support anticipated until kde-4.6 either. The best solution to this is to grab what we in the US call a "horse blanket", shape it into a circle on the bed beside you, and convince the cat to sleep there instead. Just make sure it doesnt look too organized/tidy or the cat will just ignore it. 

This resolved the issue for me years ago, hopefully it works for you too.

----------

## reup

I deactivate both acpid and laptop_mode, I remove all the rules from /etc/acpid and rebooted, to no avail

every time I close the lid of my laptop, been on KDE or on Gnome (yes I installed both) I get a logoff

every time I press the on/off button, I am presented with the logoff/shutdown menu, as my setting demand, but immeditaly the laptop shutdown

it seems obvious to me that there is another system taking care of the power management here, but I cannot imagine which one 

I followed the gentoo power management guide http://www.gentoo.org/doc/en/power-management-guide.xml

also, I have fedora on dual boot and do not have this issue on fedora, so I am sure it is not some BIOS strange settings taking over the OS (if this is possible)

----------

## reup

I run 

```
 tail -f /var/log/messages >> result
```

and then closed the lid of the laptop

I got the following

```
Jun 14 02:41:30 ABC logger: ACPI event unhandled: video OVGA 00000080 00000000

Jun 14 02:41:30 ABC logger: ACPI event unhandled: button/lid LID0 00000080 0000000b

Jun 14 02:41:30 ABC kernel: [ 1288.781304] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:30 ABC kernel: [ 1288.963446] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:30 ABC kernel: [ 1289.186930] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:30 ABC kernel: [ 1289.368498] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:31 ABC kernel: [ 1289.697326] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:31 ABC kernel: [ 1289.880251] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:31 ABC kernel: [ 1290.154342] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:31 ABC kernel: [ 1290.336466] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:32 ABC kernel: [ 1290.571301] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:32 ABC kernel: [ 1290.760414] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:35 ABC kernel: [ 1293.680338] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:35 ABC kernel: [ 1293.862432] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:35 ABC kernel: [ 1294.229313] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:35 ABC kernel: [ 1294.411305] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:36 ABC kernel: [ 1295.032861] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:36 ABC kernel: [ 1295.214890] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:41 ABC logger: ACPI event unhandled: video OVGA 00000080 00000000

Jun 14 02:41:41 ABC logger: ACPI event unhandled: button/lid LID0 00000080 0000000c

Jun 14 02:41:41 ABC kernel: [ 1300.457792] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:42 ABC kernel: [ 1300.639483] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:42 ABC kernel: [ 1300.957881] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:42 ABC kernel: [ 1301.139912] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:42 ABC kernel: [ 1301.532591] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:43 ABC kernel: [ 1301.714414] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:43 ABC kernel: [ 1302.044225] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:43 ABC kernel: [ 1302.227720] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:44 ABC kernel: [ 1302.546200] [drm] TV-20: set mode NTSC 480i 0

```

when I reopen the laptop, the session had loggedoff

I then press on the sleep/shutdown button and after I got the logout/shutdown menu, I got the following in the /var/log/messages

```
Jun 14 02:41:47 ABC acpid: client connected from 8459[0:0]

Jun 14 02:41:47 ABC acpid: 1 client rule loaded

Jun 14 02:41:48 ABC kernel: [ 1306.961229] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:48 ABC kernel: [ 1307.103400] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:48 ABC kernel: [ 1307.378217] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:41:48 ABC kernel: [ 1307.520316] [drm] TV-20: set mode NTSC 480i 0

Jun 14 02:42:58 ABC kernel: [ 1377.537654] usb 2-1:1.0: uevent

Jun 14 02:42:58 ABC kernel: [ 1377.537706] usb 2-1:1.1: uevent

Jun 14 02:42:58 ABC kernel: [ 1377.537757] usb 2-1:1.2: uevent

Jun 14 02:42:58 ABC kernel: [ 1377.537809] usb 2-1:1.3: uevent

Jun 14 02:43:48 ABC sudo:     root : TTY=pts/3 ; PWD=/root ; USER=root ; COMMAND=/bin/tail -f /var/log/messages

Jun 14 02:43:48 ABC sudo: pam_unix(sudo:session): session opened for user root by reup(uid=0)

Jun 14 02:43:48 ABC sudo: pam_unix(sudo:session): session closed for user root

Jun 14 02:43:51 ABC init: Switching to runlevel: 0

```

anyone understand this ??

----------

## reup

as it seems that drm is part of my issue, I grep the message file for drm, few hundred of "[drm] TV-20: set mode NTSC 480i 0" so I grep a bit more and this is the result

lots of errors

```
Jun 14 02:14:08 ABC kernel: [    0.301545] [drm] Initialized drm 1.1.0 20060810

Jun 14 02:14:08 ABC kernel: [    0.319790] [drm] set up 63M of stolen space

Jun 14 02:14:08 ABC kernel: [    1.431338] [drm] LVDS-8: set mode 1280x800 23

Jun 14 02:14:08 ABC kernel: [    1.480279] fb0: inteldrmfb frame buffer device

Jun 14 02:14:08 ABC kernel: [    1.496440] [drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on minor 0

Jun 14 02:18:50 ABC kernel: [  546.397033] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung

Jun 14 02:18:50 ABC kernel: [  546.397117] [drm:i915_do_wait_request] *ERROR* i915_do_wait_request returns -5 (awaiting 46546 at 46545)

Jun 14 02:18:50 ABC kernel: [  546.499176] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung

Jun 14 02:18:50 ABC kernel: [  546.499225] [drm:i915_do_wait_request] *ERROR* i915_do_wait_request returns -5 (awaiting 46554 at 46545)

Jun 14 02:18:50 ABC kernel: [  546.499542] [drm:i915_gem_execbuffer] *ERROR* Execbuf while wedged

Jun 14 02:18:50 ABC kernel: [  546.778236] [drm] LVDS-8: set mode 1280x800 23

Jun 14 02:18:51 ABC kernel: [  547.312094] [drm] LVDS-8: set mode 1280x800 23

Jun 14 02:18:52 ABC kernel: [  548.249330] [drm] LVDS-8: set mode 1280x800 23

Jun 14 02:18:52 ABC kernel: [  548.390725] [drm] LVDS-8: set mode 1280x800 23

Jun 14 02:18:52 ABC kernel: [  548.852660] [drm] LVDS-8: set mode 1280x800 23

Jun 14 02:20:22 ABC kernel: [    0.308301] [drm] Initialized drm 1.1.0 20060810

Jun 14 02:20:22 ABC kernel: [    0.325508] [drm] set up 63M of stolen space

Jun 14 02:20:22 ABC kernel: [    1.439324] [drm] LVDS-8: set mode 1280x800 23

Jun 14 02:20:22 ABC kernel: [    1.488230] fb0: inteldrmfb frame buffer device

Jun 14 02:20:22 ABC kernel: [    1.504824] [drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on minor 0

Jun 14 02:27:24 ABC kernel: [  443.312057] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung

Jun 14 02:27:24 ABC kernel: [  443.312109] [drm:i915_do_wait_request] *ERROR* i915_do_wait_request returns -5 (awaiting 56569 at 56568)

Jun 14 02:27:24 ABC kernel: [  443.423054] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung

Jun 14 02:27:24 ABC kernel: [  443.423259] [drm:i915_do_wait_request] *ERROR* i915_do_wait_request returns -5 (awaiting 56571 at 56568)

Jun 14 02:27:24 ABC kernel: [  443.423397] [drm:i915_gem_execbuffer] *ERROR* Execbuf while wedged

Jun 14 02:27:25 ABC kernel: [  443.705378] [drm] LVDS-8: set mode 1280x800 23

Jun 14 02:31:13 ABC kernel: [  672.113052] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung

Jun 14 02:31:13 ABC kernel: [  672.113100] [drm:i915_do_wait_request] *ERROR* i915_do_wait_request returns -5 (awaiting 138006 at 138005)

Jun 14 02:31:13 ABC kernel: [  672.113386] [drm:i915_gem_execbuffer] *ERROR* Execbuf while wedged

Jun 14 02:31:13 ABC kernel: [  672.371489] [drm] LVDS-8: set mode 1280x800 23

Jun 14 02:32:56 ABC kernel: [  774.735756] [drm] LVDS-8: set mode 1280x800 23

Jun 14 02:33:29 ABC kernel: [  808.352820] [drm] LVDS-8: set mode 1280x800 23

Jun 14 02:37:14 ABC kernel: [ 1032.718895] [drm] LVDS-8: set mode 1280x800 23

Jun 14 02:41:45 ABC kernel: [ 1304.454058] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung

Jun 14 02:41:45 ABC kernel: [ 1304.454104] [drm:i915_do_wait_request] *ERROR* i915_do_wait_request returns -5 (awaiting 200306 at 200305)

Jun 14 02:41:46 ABC kernel: [ 1304.551038] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung

Jun 14 02:41:46 ABC kernel: [ 1304.551121] [drm:i915_do_wait_request] *ERROR* i915_do_wait_request returns -5 (awaiting 200310 at 200305)

Jun 14 02:41:46 ABC kernel: [ 1304.551318] [drm:i915_gem_execbuffer] *ERROR* Execbuf while wedged

Jun 14 02:41:46 ABC kernel: [ 1304.807543] [drm] LVDS-8: set mode 1280x800 23

```

----------

## lmmsci

reup: have you upgraded the kernel last time?

I've had similar problems with kernel 2.6.34. Lid closed - log out. Downgrade to 2.6.32 helped (zen in fact, not gentoo sources). Perhaps there is something changed in kernel and other parts of system cannot communicate with it in proper way any more... Maybe it's right, that something with drm subsystem is not well.

----------

## reup

eix gentoo-sources

[I] sys-kernel/gentoo-sources

     Installed versions:  2.6.32-r7(2.6.32-r7)

(I am currently on chroot from fedora so uname would return the fedora kernel)

I have only stable installed on my gentoo. I use kernel 2.6.32-r7

I think the problem is link to hal with polkit. I have started my gentoo with all services disabled and started them one by one, I suddenly had a wrong behavior as soon as I started hal. it started consolekit at the same time and then closing the lid logged me out. without hal, closing the lid was going to sleep mode

I have rebuild hal and all associated package as well as kde without polkit, consolekit and will try soon to see the result

----------

## reup

this is getting worse and worse. after removing consolekit and policykit, I cannot emerge anything without having a warning that consolekit with useflag policykit is needed

kdm does not work anymore and kde return an error about .dmrc not belonging to my user (even if it does)

removing all kit package did not do anything, I still get logged out when I close the lid, I beleive now it has something to do with acpid and not consolekit

----------

## reup

so after few month fighting with this issue I have finally resolve the power off on button press

the answers was given to me earlier in this forum but I did not understand it well

I finally commented the power button lines in the /etc/acpi/default.sh file and let acpi running. 

now I can press on the power button and have kde present me with the 4 options of logout/powerdown/sleep/hibernate and I have the choise, even to cancel the action

I found out as well that if I lock the screen (CTRL-ALT-L on kde) I can close my lid and have the cat sleep on the computer without login out

I will mark this one as solved

----------

