# Problem with automatic rehibernate after resume on battery

## rona_dinihari

I have a problem with hibernation. When I resume my laptop without AC pluged after hibernation, it rehibernate again right after resume completed. Usually it happens if I resume after it hibernate after a long time. If I resume only after a few minutes after it hibernate the problem does not appear.

Anybody knows how to fix this?

I am using tuxonice-sources. If gentoo-sources is the only way to fix this then I'll go for it. But then I need a guide to convert from tuxonice-sources suspend installation to gentoo-sources way.

----------

## dmpogo

 *rona_dinihari wrote:*   

> I have a problem with hibernation. When I resume my laptop without AC pluged after hibernation, it rehibernate again right after resume completed. Usually it happens if I resume after it hibernate after a long time. If I resume only after a few minutes after it hibernate the problem does not appear.
> 
> Anybody knows how to fix this?
> 
> I am using tuxonice-sources. If gentoo-sources is the only way to fix this then I'll go for it. But then I need a guide to convert from tuxonice-sources suspend installation to gentoo-sources way.

 

It's more probably interaction with your desktop power managements settings.  When you do not have AC in,  is there relation with the battery level whether it happens or not ? 

Also, you do mean hibernation (i.e to disk), not suspend (i.e to RAM) ?

----------

## rona_dinihari

I'm using gnome-light-2.26.3. I do set my power manager to hibernate if idle more than 15 minutes when running only on battery. Is this it? I thought the idle timer reset after resume?

I can set the idle time before hibernate to never. But I worry about reliying only on hibernate on battery critical option.

I'll set the idle time to never and test it again later.

I don't think it's battery level. When without AC in, battery was at least above 50%.

I only use hibernate to disk. I can try suspend to RAM. But I am not going to use suspend to RAM. Only hibernate to disk.

Thanks for the fast response.   :Smile: 

----------

## dmpogo

 *rona_dinihari wrote:*   

> I'm using gnome-light-2.26.3. I do set my power manager to hibernate if idle more than 15 minutes when running only on battery. Is this it? I thought the idle timer reset after resume?
> 
> I can set the idle time before hibernate to never. But I worry about reliying only on hibernate on battery critical option.
> 
> I'll set the idle time to never and test it again later.
> ...

 

General comments - there is no point really of hibernating after 15 min - hybernating is quite a long process, and takes some time to resume (essentially as much as to boot). It is useful if you want to pick up your laptop and move to your office, or shut it off overnight to start where you stopped a day before. So I would automatically hybernate only on critical.

More specifically, I think it is quite probable that the issue is timer and gnome putting it back to sleep right away.

You can check it disabling autmatic 15 min hibernation, and do manual hybernate (Fn-F12 if it is set up or run

```

/usr/bin/hibernate  

```

which comes with  sys-power/hibernate-script package that is part of tuxonice distribution.

And see whether you have your problem with resuming then

----------

## rona_dinihari

I've set hibernate on idle timer to never. Now the problem is gone. The hibernate on battery critical also works. Thank you.   :Smile: 

----------

## dmpogo

 *rona_dinihari wrote:*   

> I've set hibernate on idle timer to never. Now the problem is gone. The hibernate on battery critical also works. Thank you.  

 

it does look like gnome power management bug, and perhaps deserves filing a bug report. It seems what happens is the following

1. Gnome sets a timer from the last interaction

2. Hibernate stores the state of the machine exactly as it is

3. On wake up, when gnome is reactivated, it checks the  (re)stored time of the last interaction with the current time,

and if hibernation was more than 15 min,  decides that machine was idle for > 15 min and hibernates again.

If this is correct that actually will be a problem every time you hibernate for more than the automatic interval. And sometimes even with shorter hibernations if there was an idle period before hibernation kicked it.

Which actually is a bug and renders the feature pretty useless.

----------

## rona_dinihari

I've found the bug report:

https://bugzilla.gnome.org/show_bug.cgi?id=486138

I'm stil using gnome-power-manager-2.22.1. They say it's not going to be fixed in 2.22. Which means it should be in > 2.22 right? Has anybody used any? It still marked with keyword in gentoo. Is any proven stable > 2.22 version compatible with gnome-light 2.26.3?

Sometimes I have to resume without AC. If it was hibernated with battery critically low, then I couldn't resume.

----------

