Powernap should ensure WoL is enabled before Second Stage

Bug #989175 reported by vincefn
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
powernap
Confirmed
Wishlist
Unassigned
pm-utils (Ubuntu)
Confirmed
Wishlist
Unassigned
powernap (Ubuntu)
Confirmed
Wishlist
Unassigned

Bug Description

PowerNap should ensure that WoL is enabled before executing the second stage action (poweroff/susped) as first stage action (powersave) will disable WoL.

Note that powernap does not disable WoL, but rather, pm-utils ships a script called disable_wol.

============= Background ================
I have a server running Ubuntu 12.04. The current issue is the following:

* if I activate 2nd-stage powernap to poweroff (or 'shutdown -h' by using /etc/powernap/action), the computer will not wake when sent a magic packet.

* if however, I manually shutdown the computer (using shutdown -h from the console), the computer can be woken up with a magic packet without any problem.

I have no idea about the reason for this. I used previously powernap with 11.04 (or 11.10, I don't remember) and it worked correctly (the current installation is a clean one).

I have attached the powernap main config (with 2nd stage deactivated, but of course I ran the tests by activating it).

Note that the symptoms are the same if I try using suspend instead of poweroff/shutdown -h

############################
Description: Ubuntu 12.04 LTS
Release: 12.04
############################
root@souris:~# apt-cache policy powernap
powernap:
  Installé : 2.17-0ubuntu2
  Candidat : 2.17-0ubuntu2
 Table de version :
 *** 2.17-0ubuntu2 0
        500 http://fr.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status

############################
root@souris:~# ethtool eth0
Settings for eth0:
 Supported ports: [ TP MII ]
 Supported link modes: 10baseT/Half 10baseT/Full
                         100baseT/Half 100baseT/Full
                         1000baseT/Half 1000baseT/Full
 Supported pause frame use: No
 Supports auto-negotiation: Yes
 Advertised link modes: 10baseT/Half 10baseT/Full
                         100baseT/Half 100baseT/Full
                         1000baseT/Half 1000baseT/Full
 Advertised pause frame use: Symmetric Receive-only
 Advertised auto-negotiation: Yes
 Link partner advertised link modes: 10baseT/Half 10baseT/Full
                                      100baseT/Half 100baseT/Full
                                      1000baseT/Half 1000baseT/Full
 Link partner advertised pause frame use: Symmetric Receive-only
 Link partner advertised auto-negotiation: Yes
 Speed: 1000Mb/s
 Duplex: Full
 Port: MII
 PHYAD: 0
 Transceiver: internal
 Auto-negotiation: on
 Supports Wake-on: pumbg
 Wake-on: g
 Current message level: 0x00000033 (51)
          drv probe ifdown ifup
 Link detected: yes
---
ApportVersion: 2.0.1-0ubuntu5
Architecture: amd64
DistroRelease: Ubuntu 12.04
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha amd64 (20120324.1)
Package: powernap 2.17-0ubuntu2 [modified: usr/sbin/powernap]
PackageArchitecture: all
ProcVersionSignature: Ubuntu 3.2.0-23.36-generic 3.2.14
Tags: precise
Uname: Linux 3.2.0-23-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
mtime.conffile..etc.powernap.action: 2012-04-18T22:08:05.480260
mtime.conffile..etc.powernap.config: 2012-04-25T20:25:37.642992

Revision history for this message
vincefn (vincent-favre-nicolin) wrote :
Revision history for this message
Aditya V (kroq-gar78) wrote :

Thank you for reporting this bug. Can you please run "apport-collect 989175" to collect some information on your system so that it might be easier to diagnose? Also, what does "WOL" mean?

Revision history for this message
vincefn (vincent-favre-nicolin) wrote : Dependencies.txt

apport information

tags: added: apport-collected precise
description: updated
Revision history for this message
vincefn (vincent-favre-nicolin) wrote : ProcEnviron.txt

apport information

Revision history for this message
vincefn (vincent-favre-nicolin) wrote : modified.conffile..etc.powernap.action.txt

apport information

Revision history for this message
vincefn (vincent-favre-nicolin) wrote : modified.conffile..etc.powernap.config.txt

apport information

Revision history for this message
vincefn (vincent-favre-nicolin) wrote : Re: Powernap prevents waking from WOL

Added the apport information.

WOL=WakeOnLAN

thanks.

Revision history for this message
Aditya V (kroq-gar78) wrote : Re: [Bug 989175] Re: Powernap prevents waking from WOL

Body:

Thanks. I was just making sure ;)

 summary "Powernap prevents waking from WakeOnLAN"

Sincerely,
kroq-gar78

Aditya V (kroq-gar78)
summary: - Powernap prevents waking from WOL
+ Powernap prevents waking from WakeOnLAN
Revision history for this message
vincefn (vincent-favre-nicolin) wrote : Re: Powernap prevents waking from WakeOnLAN
Download full text (9.5 KiB)

OK, I think I have found the reason for this bug. It is not due to stage 2 in power nap, but rather stage 1 - during powersave mode the ethernet configuration for the card is changed, which deactivates wake-on-lan.

Since power nap first enters in stage1 then stage2, when the computer is turned off (or suspended) in stage 2, the wake-on-lan is deactivated... Of course I do *not* see this when manually shutting down, because my typing on the console or through ssh gets the computer out of powersave mode.

Here is the log file which demonstrates this. It is produced by a while loop which logs the end of /var/log/powernap.log and the result of "ethtool eth0" every 5 seconds. As you can see below the first two logged entries (at t=0s and t=5s) have "Wake-on: g" but at t=+10s there is "Wake-on: d" which I assume means deactivated...

=> I am not sure where power nap changes this, isn't it supposed to just change speed ?

####### Time series of /var/log/powernap.log and "ethtool eth0" at 5s intervals #########

samedi 28 avril 2012, 11:24:08 (UTC+0200)
2012-04-28_11:23:45 WARNING Entered into GRACE PERIOD. Action [/usr/sbin/powernap] will be taken in [3] seconds
2012-04-28_11:23:46 WARNING Entered into GRACE PERIOD. Action [/usr/sbin/powernap] will be taken in [2] seconds
2012-04-28_11:23:46 WARNING Taking action [/usr/sbin/powernap]
2012-04-28_11:23:50 WARNING Taking recover action [/usr/sbin/pm-powersave false]
2012-04-28_11:23:59 WARNING Entered into GRACE PERIOD. Action [/usr/sbin/powernap] will be taken in [6] seconds
2012-04-28_11:24:00 WARNING Entered into GRACE PERIOD. Action [/usr/sbin/powernap] will be taken in [5] seconds
2012-04-28_11:24:02 WARNING Entered into GRACE PERIOD. Action [/usr/sbin/powernap] will be taken in [4] seconds
2012-04-28_11:24:05 WARNING Entered into GRACE PERIOD. Action [/usr/sbin/powernap] will be taken in [6] seconds
2012-04-28_11:24:06 WARNING Entered into GRACE PERIOD. Action [/usr/sbin/powernap] will be taken in [5] seconds
2012-04-28_11:24:08 WARNING Entered into GRACE PERIOD. Action [/usr/sbin/powernap] will be taken in [4] seconds
Settings for eth0:
 Supported ports: [ TP MII ]
 Supported link modes: 10baseT/Half 10baseT/Full
                         100baseT/Half 100baseT/Full
                         1000baseT/Half 1000baseT/Full
 Supported pause frame use: No
 Supports auto-negotiation: Yes
 Advertised link modes: 10baseT/Half 10baseT/Full
                         100baseT/Half 100baseT/Full
                         1000baseT/Half 1000baseT/Full
 Advertised pause frame use: Symmetric Receive-only
 Advertised auto-negotiation: Yes
 Link partner advertised link modes: 10baseT/Half 10baseT/Full
                                      100baseT/Half 100baseT/Full
                                      1000baseT/Half 1000baseT/Full
 Link partner advertised pause frame use: Symmetric Receive-only
 Link partner advertised auto-negotiation: Yes
 Speed: 1000Mb/s
 Duplex: Full
 Port: MII
 PHYAD: 0
 Transceiver: internal
 Auto-negotiation: on
 Supports Wake-on: pumbg
 Wake-on: g
 Current message level: 0x00000033 (51)
          drv probe ifdown ifup
 Link detected: yes

samedi 28 avril 2012, 11...

Read more...

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi there,

Thank you for taking the time to look into this. This is actually not a PowerNap bug, but rather, pm-utils (not really a bug though). pm-utils ships a disable_wol script that, as its name says, disables wake-on-lan when executing the pm-powersave (which powernap executes).

To fix this, you could either disable this script when pm-powersave executes by removing the execution bit form the script. You'll find the script at:

/usr/lib/pm-utils/power.d/disable_wol

Now, what should be done in PowerNap though, is to ensure WoL is enabled when performing a poweroff/suspend action. I'll retarget this bug for that.

Cheers.

Changed in powernap (Ubuntu):
status: New → Triaged
status: Triaged → Confirmed
summary: - Powernap prevents waking from WakeOnLAN
+ Powernap should ensure WoL is enabled before Second Stage
description: updated
Changed in powernap:
status: New → Confirmed
importance: Undecided → Wishlist
Changed in powernap (Ubuntu):
importance: Undecided → Low
importance: Low → Wishlist
Revision history for this message
vincefn (vincent-favre-nicolin) wrote :

Thanks for the quick answer ! Indeed it is an issue between powernap and pm-utils. I had looked in /etc/pm but did not think to look in /usr/lib/pm-utils.

I really think this disable_wol should be deactivated by default (how much power does that save ?) - many people will want to use auto suspend/poweroff with WoL enabled for servers.

And by the way, thanks a lot for powernap, it is really useful ! Can't wait for the autowake-up using ARP :-)

Revision history for this message
Aditya V (kroq-gar78) wrote :

So should I set it as affecting 'pm-utils' too?

Revision history for this message
Andres Rodriguez (andreserl) wrote :

@kroq-gar78: I think it would be better to file a new bug.

@vincefn: The "PowerNap Server" features (That includes the ARP monitors to autowake PoweNap clients) have been disabled in Precise because it was only a preview of what could be done with PowerNap and I didn't have the time to finish it. I however, can re-enable it and make it available in PPA for you to use.

Revision history for this message
vincefn (vincent-favre-nicolin) wrote :

@Andres - thanks, it would be nice to be able too test the wake-on-ARP, so putting this in a PPA looks like a great idea.

This being said, I just realized that my server does not have the "Wake-On: a" support that is required, so I won't be able to test this unless I change the card :-(

Revision history for this message
Reinhard Tartler (siretart) wrote :

I agree with comment #11 - is disable_wol really worth the trouble? does it really save energy? if not, let's disable the script.

Changed in pm-utils (Ubuntu):
status: New → Confirmed
importance: Undecided → Wishlist
tags: added: notserv
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.