Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Networking/Wake-on-lan/Suspend

  1. #1
    Join Date
    May 2008
    Beans
    37

    Networking/Wake-on-lan/Suspend

    Hi all

    I'm using intrepid on a dell latitude d820.

    My end goal is to get wake-on-lan to work from a suspended state. I've been reading lots of literature online and it seems like this has largely been unachieved to this point, but significant progress has been made and I have some ideas.

    Firstly, wake-on-lan works perfectly fine with windows XP, so my bios supports it.

    I found this article:
    http://www.averyjparker.com/ubuntu-linux/

    In which the author claims to have got the feature to work.

    Here are the changes I made to make WOL from standby (S3) and Hibernate work.

    I edited one of the hibernate/sleep scripts:

    sudo pico /usr/lib/pm-utils/sleep.d/50modules

    and commented out (*put a # in front of the lines) that say unload_network and invoke-rc.d networking restart (This prevents networking from being shut down at suspend/standby/sleep or hibernate and if we keep them from being shutdown, we shouldn’t need to restart them.)
    Problem is, this line does not exist in my 50modules file. I figure if there is a way to disable sleep.d from disabling networking moduels, wake-on-lan will work perfectly fine from a suspended or hibernated state.

    Can anyone shed any light on this?!

    Sean

  2. #2
    Join Date
    May 2008
    Beans
    37

    Re: Networking/Wake-on-lan/Suspend

    I'm going to hate myself forever for doing this...but...

    bump!

  3. #3
    Join Date
    Sep 2006
    Location
    .nl
    Beans
    Hidden!
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Lightbulb Re: Networking/Wake-on-lan/Suspend

    I realize this is a pretty old topic by now, but I am interested in exactly the same.
    My desktop machine runs 8.04(.2), and it has the lines you mention sitting there in the script. My laptop runs 8.10 which apparently does not.
    Perhaps someone will read this and find it useful

    The good news is that my 8.04 machine does now wake from standby. There's no need to modify the /etc/init.d/halt script. In fact, if the author had read halt's manpage he'd discovered the -i flag is useless on Linux machines because the kernel does what that flag would do anyway, so also when it's not there.

    The bad news is, of course, those missing lines. Judging from the script in 8.04, it looks at all the network interfaces, looks up what their module's name is and proceeds to unload those modules. Apparently we do not want that, so the line is commented out.

    In 8.10 the suspend script unloads modules if A) they're specifically mentioned or B) they're network or USB modules. The file /etc/default/acpi-support specifies the list of modules you can whitelist so they don't get unloaded (it's MODULES_WHITELIST, I think the module names need to be space-separated, but try for yourself).

    Please note: I have not personally tried this, so I cannot guarantee that it will work. In fact, I cannot guarantee you won't make your computer shoot you in the face for doing this. However, I do think it's safe enough to try.

    So, the upshot of this is:
    0 - I don't know whether it works.
    1 - go to /sys/class/net and find the interface you want/need.
    2 - go to name_of_interface/device/driver and "ls -l" The file module turns out to be a link to the actual module. Note its name (bla../../module/this_part/)
    3 - stick "this_part" into the file /etc/default/acpi-support: MODULES_WHITELIST="<insert here>"
    4 - pray to the heathen gods for a working WOL.

    Again, I hope this is useful but I make no claims to the workingness and/or not-blowing-your-computer-upness of this method.

  4. #4
    Join Date
    May 2007
    Beans
    19

    Re: Networking/Wake-on-lan/Suspend

    Quote Originally Posted by Trebaruna View Post
    3 - stick "this_part" into the file /etc/default/acpi-support: MODULES_WHITELIST="<insert here>"
    I don't appear to have the file acpi-support anywhere.
    Just upgraded to Jaunty and still don't have it.

    My system resumes from S3 on WOL only once per boot, i.e. I boot, then 'sudo pm-suspend' then send a magic packet, and it rusumes, then I issue 'sudo pm-suspend' again, it suspends, but then won't respond to magic packets any more, it will only wake from keyboard or power button.

  5. #5
    Join Date
    May 2008
    Beans
    37

    Re: Networking/Wake-on-lan/Suspend

    Excellent, this solution works for me!!

    Only issue I'm having now is that occasionally networking is disabled when resuming from standby, but I used to have this problem even without WOL.

  6. #6
    Join Date
    Sep 2006
    Location
    .nl
    Beans
    Hidden!
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Networking/Wake-on-lan/Suspend

    Quote Originally Posted by TheSeanKelly View Post
    Excellent, this solution works for me!!

    Only issue I'm having now is that occasionally networking is disabled when resuming from standby, but I used to have this problem even without WOL.
    Very glad it's working!

    I've seen this issue on my laptop as well, but I haven't looked into it at all. I'd recommend trying to see if a manual configuration is more robust, so you can disable Network Manager altogether. You can specify interfaces and IP addresses (or DHCP) in /etc/network/interfaces
    The process isn't terribly difficult, but you'll need to search the web/forums to find guides and examples, because I don't know the syntax very well.
    Also, perhaps you can see if there's a bug report, and if not, make one?

    Quote Originally Posted by rickwookie
    I don't appear to have the file acpi-support anywhere.
    According to aptitude the package acpi-support is not installed automatically, and this package provides that file. Try installing it and see if the file appears. Perhaps the packages acpid and acpi will also benefit you? Check their description to see whether you need/want them. I don't know when I installed them or why exactly, to be honest.
    I'm afraid I have no idea why it would only resume once. I suggest looking around to see if this is a known bug.

  7. #7
    Join Date
    May 2007
    Beans
    19

    Re: Networking/Wake-on-lan/Suspend

    Quote Originally Posted by Trebaruna View Post
    According to aptitude the package acpi-support is not installed automatically, and this package provides that file. Try installing it and see if the file appears. Perhaps the packages acpid and acpi will also benefit you? Check their description to see whether you need/want them. I don't know when I installed them or why exactly, to be honest.
    I'm afraid I have no idea why it would only resume once. I suggest looking around to see if this is a known bug.
    I installed the acpi-support package using aptitude, but looking at /etc/default/acpi-support is see that MODULES_WHITELIST is under the section marked:
    Code:
    #
    # LEGACY BUILT IN SUSPEND SUPPORT (DEPRECATED)
    # --------------------------------------------
    #
    # These options only work for the "acpi-support" suspend method. This is NOT
    # recommended, but is retained for backward compatibility reasons.
    #
    and since above that is:
    Code:
    SUSPEND_METHODS="dbus-pm dbus-hal pm-utils"
    and I've been using:
    Code:
    sudo pm-suspend
    to sleep, I'm not sure that it's going to help.

    I suspect that the network modules being unloaded/loaded is controlled by config files for pm-utils, but they seem to be scattered all over the place (/usr/lib/pm-utils/ and /etc/pm/) and I can't follow them.

    The fact that it works once surely means that something is set up correctly at boot time that isn't re-set during a resume from suspend.

    BTW my network connection always functions correctly after a resume from sleep (either the first WOL one, or via the power button).
    Last edited by rickwookie; April 4th, 2009 at 02:31 PM.

  8. #8
    Join Date
    Sep 2006
    Location
    .nl
    Beans
    Hidden!
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Networking/Wake-on-lan/Suspend

    Hmm, it also has those lines in 8.10 it seems.
    Keep in mind you can use Synaptic to see what files belong to a given package. Right-click the package you're interested in and select the Installed Files tab for a list.

    I'm afraid I cannot offer you any more...

  9. #9
    Join Date
    Oct 2007
    Beans
    Hidden!

    Re: Networking/Wake-on-lan/Suspend

    Im having the exact same problem. WOL works fine when the machine is turned off. It works ONCE when it it is in suspend, after typing:

    sudo ethtool -s eth2 wol g

    Second time, after being woken from suspend, it wont wake up again. Unless I type in that command again.

    So this should be simple to solve, I probably just need to have that command somewhere in a script that is run each time when the machine resumes, but Im too much of a newbie to know how or where to do that.

    Can anyone help?

    also, Im looking for a way to have the machine wake up for printing (its used as printserver) without having to type a wakeonlan command on the client from which I want to print. Is that possible somehow?

  10. #10
    Join Date
    Nov 2005
    Location
    Leeds, UK
    Beans
    1,634
    Distro
    Ubuntu Development Release

    Re: Networking/Wake-on-lan/Suspend

    Quote Originally Posted by Trebaruna View Post
    I realize this is a pretty old topic by now, but I am interested in exactly the same.
    My desktop machine runs 8.04(.2), and it has the lines you mention sitting there in the script. My laptop runs 8.10 which apparently does not.
    Perhaps someone will read this and find it useful

    The good news is that my 8.04 machine does now wake from standby. There's no need to modify the /etc/init.d/halt script. In fact, if the author had read halt's manpage he'd discovered the -i flag is useless on Linux machines because the kernel does what that flag would do anyway, so also when it's not there.

    The bad news is, of course, those missing lines. Judging from the script in 8.04, it looks at all the network interfaces, looks up what their module's name is and proceeds to unload those modules. Apparently we do not want that, so the line is commented out.

    In 8.10 the suspend script unloads modules if A) they're specifically mentioned or B) they're network or USB modules. The file /etc/default/acpi-support specifies the list of modules you can whitelist so they don't get unloaded (it's MODULES_WHITELIST, I think the module names need to be space-separated, but try for yourself).

    Please note: I have not personally tried this, so I cannot guarantee that it will work. In fact, I cannot guarantee you won't make your computer shoot you in the face for doing this. However, I do think it's safe enough to try.

    So, the upshot of this is:
    0 - I don't know whether it works.
    1 - go to /sys/class/net and find the interface you want/need.
    2 - go to name_of_interface/device/driver and "ls -l" The file module turns out to be a link to the actual module. Note its name (bla../../module/this_part/)
    3 - stick "this_part" into the file /etc/default/acpi-support: MODULES_WHITELIST="<insert here>"
    4 - pray to the heathen gods for a working WOL.

    Again, I hope this is useful but I make no claims to the workingness and/or not-blowing-your-computer-upness of this method.
    Works perfectly, thanks!

    I'm trying to take this one step backwards and WOL my old computer which only supports APM. Would it be possible if I suspend it with apm -s?
    Last edited by durand; April 13th, 2009 at 11:53 PM.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •