Find the answer to your Linux question:
Results 1 to 4 of 4
I'm running Ubuntu 8.10 on my laptop (Rig 4, specs here ), and I have a script in my /etc/rc.local that runs every time I boot. Due to some bugs ...
  1. #1
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496

    Launch a script on wake from suspend?

    I'm running Ubuntu 8.10 on my laptop (Rig 4, specs here), and I have a script in my /etc/rc.local that runs every time I boot. Due to some bugs in my harddrive controller, my harddrive likes to park itself about every two or three minutes and the noise (not to mention the potential for wearing out the heads) bothers me greatly, so I'm using hdparm to stop it.

    However, when I wake from a suspended state the hdparm settings get undone and again I'm stuck with a constantly-clicking harddrive unless I manually run the hdparm script again. I've created a shell script that does this and I can run it, I'm just curious if someone knows of a way I can automate this? Is there perhaps a way to re-run my rc.local?

    The script is one line:
    Code:
    hdparm -B254 /dev/sda
    It requires root privileges, which in the case of rc.local isn't an issue, but it is when I launch as a regular user. Just something to consider when thinking of solutions.
    Registered Linux user #270181
    TechieMoe's Tech Rants

  2. #2
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496
    bump.......
    Registered Linux user #270181
    TechieMoe's Tech Rants

  3. #3
    Linux Engineer Thrillhouse's Avatar
    Join Date
    Jun 2006
    Location
    Arlington, VA, USA
    Posts
    1,377
    Moe, have you checked to see if acpid can handle this?

    I'm thinking something like putting your command in a script (say, parm.sh), putting the script in /etc/acpi/actions, then adding to the conf file in /etc/acpi/events:
    Code:
    event=wakeup
    action=/etc/acpi/actions/parm.sh
    "wakeup" is one of the events in /proc/acpi but I'm not sure if it's the exact one you need. Check here. If that doesn't work, hopefully it will send you down the right path.

  4. #4
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496
    Thanks, I'll give that a shot when I get home today.
    Registered Linux user #270181
    TechieMoe's Tech Rants

Posting Permissions

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