View previous topic :: View next topic |
Author |
Message |
skorefish Apprentice
Joined: 21 Jun 2015 Posts: 285
|
Posted: Wed May 04, 2016 2:16 pm Post subject: is it possible to run a script after resuming frm sleep mode |
|
|
hello,
I would like to run a script after i resume from sleep, to put back the hdparm parameters.
it should execute something like /etc/init.d/hdparm restart
How is this done using open-rc ?
i already typed: rc-update add hdparm default so at startup this works. But after resume i still have to type it in manually |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3134
|
Posted: Wed May 04, 2016 5:31 pm Post subject: |
|
|
It is possible
Quote: | # cat /etc/pm/sleep.d/hostapd
#! /bin/bash
if /etc/init.d/hostapd status
then /etc/init.d/hostapd restart
fi
|
"Restart hostapd if it was started before suspend" |
|
Back to top |
|
|
skorefish Apprentice
Joined: 21 Jun 2015 Posts: 285
|
Posted: Thu May 05, 2016 10:56 am Post subject: |
|
|
so i made a file
in /etc/pm/sleep.d/hdparm
Code: |
#! /bin/bash
if /etc/init.d/hdparm status
then /etc/init.d/hdparm restart
fi
|
and chmod 777 hdparm
but it doesn't seem to work, what do i have to do more? to make this work automaticly after resume from sleep? |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3134
|
Posted: Thu May 05, 2016 6:25 pm Post subject: |
|
|
First things first.... Is hdparm still in status "started" after suspend, or maybe it crashes? Do you even need to check it's status?
Is your trigger script launched?
Do you have... pm-utils? |
|
Back to top |
|
|
skorefish Apprentice
Joined: 21 Jun 2015 Posts: 285
|
Posted: Thu May 05, 2016 9:24 pm Post subject: |
|
|
Quote: | First things first.... Is hdparm still in status "started" after suspend, or maybe it crashes? Do you even need to check it's status? |
Yes, it says started, but the hd spins down after resume from s2ram (it's not allowed to do that)
Quote: | Is your trigger script launched? |
i have no idea, how can i check?
Quote: | Do you have... pm-utils? |
sys-power/pm-utils 1.4.1-r6
sys-power/upower-pm-utils 0.9.23-r2
I'm using xfce4, Restart, shutdown,hybernate, suspend are greyed out( i' don't know why) |
|
Back to top |
|
|
|