# LXDE+NetworkManager<=>Suspend ok, Hibernate ko! [SOLVED]

## CaptainBlood

Hi dear all,

my laptop wakes up from suspends to ram, perfectly

However resuming from hibernate fails. Let me detail how :

The hibernate command seems to work fine. But once eery two times I have same test character filling up the screen.

When I restore from hibernate, the same strange screen reappears (after the system has detected a hibernation resuming request, and restored ram from the swap partition)

Plz note that I suspend/hibernate from X11 ( LXDE, but this shouldn't be the matter, should it?). Futhermore, applying Ctrl-Alt-BackSpace start a shutdown sequence, stopping the badly "resumed" X11 session, back to console mode and so on until shutdown. (Ctrl-Alt-BackSpace is not working in a regular X11 session!)

I don't know  how to trigger hibernate from console, which could be helpful for a better understanding of the origin of the issue.

Unfortunately I only have fglrx installed, no xorg radeon driver. Lazy to manage a xorg.conf update I guess.

Any idea how to sort that out? (Lucky me I have suspend working ...)

Thanks for your attention.Last edited by CaptainBlood on Mon Sep 20, 2010 2:40 pm; edited 5 times in total

----------

## CaptainBlood

Answering to myself ... Hoping to help someone  :Smile: 

After a little experiment, it so appears that hibernate can be activated from console with:

```
echo disk > /sys/power/state
```

By applying the above command I come to conclusion that:

Hibernate works fine from standalone root console. :Smile: 

Hibernate works fine from root console, with X11(LXDE) running in another console. :Very Happy: 

Hibernate works fine from root account within xterminal under X11(LXDE). :Shocked: 

Now the issue remains : Hibernate doesn't work properly from my non root X11(LXDE) logoff menu. :Evil or Very Mad: 

Thanks for your attention.

----------

## CaptainBlood

A little more on the subject :

```
pm-hibernate
```

works fine as root whereas

```
pm-suspend
```

doesn't ... Driving me nuts  :Mad: 

----------

## CaptainBlood

As mentionned at http://wiki.archlinux.org/index.php/LXDE,

 *Quote:*   

> If you still encounter problems, add inbetween the <config></config> tags in /etc/PolicyKit/PolicyKit.conf the folowing lines: 

 

```
<match action="org.freedesktop.hal.power-management.shutdown">

 <return result="yes"/>

</match>

<match action="org.freedesktop.hal.power-management.reboot">

 <return result="yes"/>

</match>

<match action="org.freedesktop.hal.power-management.suspend">

 <return result="yes"/>

</match>

<match action="org.freedesktop.hal.power-management.hibernate">

 <return result="yes"/>

</match>
```

I tried it, improving but unreliable ...  :Embarassed: 

----------

## CaptainBlood

My current educated guess is networkmanager is the showstopper there !

Indeed if I close all connection before hibertating, resume has been working fine each time of five attempts.

So from my point of view the current question is:

Is there a convenient way to close all network connection before pm-utils dumps memory to swap ?

An old post suggests its possible :http://www.phocean.net/2007/08/03/solved-network-manager-issue-with-acpi-hibernation.htmlNevertheless it seems very distro (Debian) specific, and should be done a very different way in Gentoo.

----------

## CaptainBlood

Finally had to do a script in /etc/pm-utils/sleep.d that forces eth0 and wlan0 down when hibernating. So something like

55nmworkaround.sh in /etc/pm/sleep.d

```
#!/bin/bash

case "$1" in

   hibernate)

      echo "Stopping eth0 and wlan0"

      ifconfig eth0 down

      ifconfig wlan0 down

      ;;

   suspend)

      echo "There should be no problem there ..."

      ;;

   thaw)

      echo "Guess it's time to resume from disk ..."

      ;;

   resume)

      echo "Guess it's time to resume from ram ..."

      ;;

   *)

      echo "Oups, a bad call I guess ..."

      ;;

esac

```

then chmod +x 55nmworkaround.sh

The hook to stop NetworkManager is the same for suspend and hibernate. For Suspend it's O.K., for Hibernate it's K.O.

My final words for a stupid issue which should have never happened IMHO.

Bye

----------

