# Halting of laptop is not proper

## v_andal

I have very weird case. To turn off my laptop, I hit the Power button. ACPI daemon starts the shutdown procedure which successfully works. But when close the lid, the laptop automatically turns on again. The only way to really keep it off is to hold Power button for 2-3 seconds.

At first, I thought this is hardware problem. But then one day, I've booted Windows and again hit Power to shut it down. And everything worked. No automatic turning on had happened when I've closed the lid. So, it looks like Gentoo Linux shuts down the machine somehow differently. And this problem appeared few months ago.

Any advice on where to look?

Just in case, my laptop is Fujitsu-Siemens Lifebook P7010

----------

## BradN

I have a different fujitsu lifebook and I noticed that when I suspend the machine and then close the lid, the machine wakes up briefly and goes back to sleep.  I suspect this is something related to fujitsu's design decisions regarding how the machine wakes up.  Probably the lid switch is set to wake the machine up on any transition, but I wouldn't expect it to fully power on from closing the lid, perhaps from opening though.

One thing you could try is a kernel parameter to make linux's ACPI identify itself as windows; you'd have to google for how to do that because I'm not sure offhand.  Other than that I don't know how this would be solved.  For a really crappy workaround, you could make your first grub entry shut the machine down (halt is the command I think) after a time delay, but you would have to intervene at every normal boot.

If you say the problem appeared recently, you could do a bisection test to find what change in the kernel caused this, but you would probably have to build and test like 15-20 kernels to do that.  I don't know the specifics but it's probably outlined somewhere on the interwebs.

----------

## Paczesiowa

what kernel version? my fujitsu-siemens started having problems with 2.6.34 - hibernation works but immediately after shutdown it reboots (no lid touching though). it worked fine with < 2.6.34

----------

## cach0rr0

can you head to pastebin.com and post your kernel config so we can have a look?

----------

## justXi

 *Paczesiowa wrote:*   

> what kernel version? my fujitsu-siemens started having problems with 2.6.34 - hibernation works but immediately after shutdown it reboots (no lid touching though). it worked fine with < 2.6.34

 

I have the problem. Yesterday I compiled gentoo-sources-2.6.34-r1 and the system does not shutdown. I used the same config (make oldconfig) which I used for my 2.6.32-gentoo-r1 kernel. It's a dektop system.

----------

## v_andal

 *cach0rr0 wrote:*   

> can you head to pastebin.com and post your kernel config so we can have a look?

 

Sorry for delay. The link to pastebin is http://pastebin.com/dfBr0W56

----------

## v_andal

 *justXi wrote:*   

>  *Paczesiowa wrote:*   what kernel version? my fujitsu-siemens started having problems with 2.6.34 - hibernation works but immediately after shutdown it reboots (no lid touching though). it worked fine with < 2.6.34 
> 
> I have the problem. Yesterday I compiled gentoo-sources-2.6.34-r1 and the system does not shutdown. I used the same config (make oldconfig) which I used for my 2.6.32-gentoo-r1 kernel. It's a dektop system.

 

Actually, it might be that in my case the problems also started with the version 2.6.34. I needed proper KMS support, so I've used vanilla-sources of this version 2 or 3 months ago. Now I've switched back to gentoo sources, but the problem persist. It is not exactly the same as described, but also has something to do with shutdown.

I've tried to boot 2.6.32 - this version does not have the problem.

Possibly, my problem is different because I didn't compile in the support for hibernation.

----------

## justXi

I tried "vanilla-sources-2.6.35_rc5" and with this kernel the system shuts down as aspected.

I used the same config as for 2.6.34.

----------

## Paczesiowa

same here, 2.6.35 fixed the problem.

----------

## justXi

Does somebody know which part of the kernel is responsible for the shutdown?

Maybee we could create a patch / backport?

----------

## BradN

Someone experiencing the problem needs to do a bisection test to find what changes affect it, or see if they can find it in the kernel changelog.

----------

## justXi

I had a quick look at the changelog of kernel 2.6.34 but did you find anything that seem to be related to this problem.

What is a "bisection test"?

----------

## BradN

Short answer:  You keep building kernels to narrow down the range of possible change sets that could contain the offending change.

Longer answer:  http://lwn.net/Articles/277872/

----------

## justXi

I tracked this down to this:

 *Quote:*   

> 
> 
> 9630bdd9b15d2f489c646d8bc04b60e53eb5ec78 is the first bad commit
> 
> commit 9630bdd9b15d2f489c646d8bc04b60e53eb5ec78
> ...

 

I think in 2.6.35 tree there is already a bug fix, maybee we could backport this, or wait for the next kernel release  :Wink: .

----------

## justXi

I searched for some patches related to this problem, but I could not find something that applies successfully against 2.6.34.

So I think kernel 2.6.35 will be released in the near future and due to my limited time I will wait and skip kernel 2.6.34.

----------

## fortin_alexandre

I have the same problem with my laptop. I upgraded the kernel from 2.6.32-gentoo-r7 (worked fine) to 2.6.34-gentoo-r1 and kept the same configuration. Now basically issuing "halt" has the same effect than "reboot". The last line on the console is "Power down." and the system reboots. My system is a HP-Compaq NX7000.

From your experience, do you think that there will be a patch for the 2.6.34 version soon or should I revert to 2.6.32 and wait for the next version hoping the bug will be fixed? And another question: I made a "make module-install" using the 2.6.34 sources. Is is safe to use my 2.6.32 kernel with the modules of the 2.6.34 version?

Thanks in advance for your help.

----------

## justXi

Currently I have no time, but I don't know if a Gentoo kernel maintainer will release a new version fixing this problem.

Normaly the old modules should stay in "/lib/modules" so if you boot your old kernel the modules from "/lib/modules/2.4.32..." should be used.

----------

## BradN

Just to clarify, the modules are installed on a per version basis, normally a newer kernel won't try to use an older kernel's modules or vice versa.

But, what can happen is if you have two kernels of the same version, it's not automatic that the system separates them - you want to look into the local version option in the kernel config in that case.  Otherwise just build modules for each kernel you use; that keeps everything happy.

Thanks for running the bisection test, justXi.

----------

## fortin_alexandre

Thanks justXi and BradN for clarifying this up for me.

----------

## justXi

Kernel 2.6.35 is out. This release should solve the problem. I will try later.

----------

## v_andal

 *justXi wrote:*   

> Kernel 2.6.35 is out. This release should solve the problem. I will try later.

 

Yes it does. At least on my laptop  :Smile:  Unfortunately it breaks the work of my synaptics touchpad   :Sad: 

----------

## svantoviit

Experienced the same problem, laptop software-shutdown resulted in a reboot, even with the 2.6.35 kernel.

On my machine it was ConsoleKit related (look for warnings in /var/log/messages)

```
Aug 23 14:08:22 localhost console-kit-daemon[5551]: WARNING: Unable to stop system: Failed to execute child process "/usr/lib64/ConsoleKit/scripts/ck-system-stop" (No such file or directory)
```

Reinstalling and restarting ConsoleKit solved it and shutdown works like expected again.

----------

