# no network after hibernate-ram [SOLVED]

## javeree

For the first time, I wanted to test suspending to ram. Using the wiki, this worked easily, except that after resume, all network interfaces are down. This is a PC that connects through ppp0 to the internet, and routes internet access for a wired interface (eth0, renamed by udev to 'lan') and wireless interface (renamed 'wlan' and running hostapd.

In order to get the network interfaces up again after resume, I have the following in /etc/hibernate/common.conf

 *Quote:*   

> OnResume 10 /etc/init.d/net.lan restart
> 
> OnResume 20 /etc/init.d/net.ppp0 restart
> 
> UnloadBlacklistedModules yes
> ...

 

The idea is that the wan access point is stopped before hibernation and restarted afterwards, which it does.

ppp0 is restarted after resume (trying upinterfaces ppp0 failed because this is a usb speedtouch modem, which seems not to reinitiallize fast enough). Anyway, this works.

The problem is that the system fails to restart the net.lan service after resume in spite of both ' UpInterfaces lan' and 'OnResume 10 /etc/init.d/net.lan restart' being present.

I see the log 'Executing /etc/init.d/net.lan restart...', but nothing happens, and I heve to reboot to get lan functionality again.

This is my logging:

 *Quote:*   

> 
> 
> Starting suspend at di sep 20 12:33:22 CEST 2011
> 
> hibernate-ram: [01] Executing CheckLastResume ...
> ...

 Last edited by javeree on Mon Oct 03, 2011 8:41 am; edited 1 time in total

----------

## mikegpitt

If it is a timing issue, why not try something like this:

```
OnResume 10 /etc/init.d/net.lan restart && /etc/init.d/net.ppp0 restart 

```

This will only start net.ppp0 after net.lan starts successfully

----------

## cwr

When I was experimenting with suspend I had to unload the network (and sound) drivers

before suspending and reload them afterwards.  Unfortunately I did this by hand, so I've

got no script I can usefully send you.

Will

----------

## javeree

It looks indeed like a timing issue. At the moment, I have solved it with the following lines:

 *Quote:*   

> OnResume 10 /etc/init.d/net.ppp0 restart
> 
> OnResume 20 sleep 10 && /etc/init.d/net.lan --verbose restart
> 
> 

 

I must have something to do with the unloading and reloading of the via_rhine module (which is blacklisted).

I consider this at the moment a workaround, and continue looking for a solution that doesn't use sleep[/quote]

----------

## mikegpitt

 *javeree wrote:*   

> 
> 
> I must have something to do with the unloading and reloading of the via_rhine module (which is blacklisted).
> 
> I consider this at the moment a workaround, and continue looking for a solution that doesn't use sleep

 If you think it's related to that module, you could unblacklist it, and remove it in your OnSuspend... something like this:

```
OnSuspend 10 rmmod via_rhine

OnResume 10 modprobe via_rhine && /etc/init.d/net.lan restart && /etc/init.d/net.ppp0 restart 
```

----------

## javeree

Unblacklisting via_rhine (which I did by uncommenting it from the blacklisted modules in /etc/hibernate/blacklist) indeed made the lan interface come up after hibernation. All that was needed was the line "Upinterfaces auto", so no OnResume or anything.

Upinterfaces auto also at first sight seemed to bring back ppp0 (because after resume, ifconfig still shows the interface up, with an IP). However, since the modem has been down during the hibernate (it is usb based), the ip address is probably not valid anymore.

Explicitly restarting net.ppp0 renews ip address.

I consider the topic now solved (and will go on now to test hibernate-disk). Maybe one day, I'll come back to the topic and check if there is a more efficient way than completely restarting net.ppp0 (e.g. by calling pppd directly, or by calling dhcp directly. For that, I still need to learn the mechanism of connection manually over ppp).

----------

