Results 1 to 4 of 4

Thread: Run a command after waking from suspend/hibernate?

  1. #1
    Join Date
    Jun 2008
    Beans
    4

    Run a command after waking from suspend/hibernate?

    I am running 9.10 on an old Dell laptop. Suspend and resume is working fine, except I lose my wireless after resuming. If I run a "rmmod ndiswrapper; modprobe ndiswrapper" manually after resuming, then all is well again.

    What I am wondering is if there's a file that gets executed automatically upon resume where I can place these commands to automate it?

    I am also open to suggestions for a less bass-ackwards approach if anyone has a suggestion. My first attempt to get this to work was to edit /etc/default/acpi-support and add ndiswrapper to the MODULES entry, but this did not fix the problem.

    Thanks in advance for any info!

  2. #2
    Join Date
    Jun 2008
    Beans
    4

    Re: Run a command after waking from suspend/hibernate?

    Did some more reading, and I was able to get it to work as follows (perhaps a kludgy solution, but I don't know a more elegant one, and it worked for me!):

    Created a new file named 0000wireless in /usr/lib/pm-utils/sleep.d, and made it executable:

    chmod a+x /usr/lib/pm-utils/sleep.d/0000wireless

    The file has the following contents:

    #!/bin/sh

    # reload ndiswrapper to get wireless to recover properly

    case "$1" in
    resume|thaw)
    rmmod ndiswrapper
    modprobe ndiswrapper
    ;;
    esac
    Last edited by King of Dreams; April 3rd, 2010 at 02:26 AM.

  3. #3
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,044
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Run a command after waking from suspend/hibernate?

    There is also /etc/default/acpi-support. You can add a list of modules to be unloaded before sleep, then reloaded after wake. This file may be deprecated in 9.10, I'm not sure. I'm running Jaunty at the moment.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  4. #4
    Join Date
    Jun 2008
    Beans
    4

    Re: Run a command after waking from suspend/hibernate?

    That was the first thing I tried, but it seemed to have no effect.

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
  •