You are not logged in.

#1 2008-12-30 09:14:43

B-Con
Member
From: USA
Registered: 2007-12-17
Posts: 554
Website

How to run a script after resume from disk in pm-utils

When I use pm-hibernate, I have a few scripts that I would like to run upon de-thawing. At the moment, all I want to do is module-related: I want to remove the pcskpr mod (which I have blacklisted in my rc.conf MODULES array, but HAL loads it upon thawing) and reprobe the ath9k mod (wireless doesn't work until I modprobe it).

I see that you can insert your own hooks for pm-utils, but when are they run? I need my script to run after HAL has its way with my module-probing/loading and I'm not getting a clear impression that this is the case. If not, then what other options exist?

Offline

#2 2008-12-30 10:10:31

bluewind
Administrator
From: Austria
Registered: 2008-07-13
Posts: 172
Website

Re: How to run a script after resume from disk in pm-utils

Offline

#3 2008-12-30 10:43:38

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: How to run a script after resume from disk in pm-utils

btw, you can blacklist pcspkr in /etc/modprobe.conf - then you won't have to bother about it on resume.

Offline

#4 2008-12-31 01:41:46

B-Con
Member
From: USA
Registered: 2007-12-17
Posts: 554
Website

Re: How to run a script after resume from disk in pm-utils

The Arch wiki is mostly the same as that. I still don't know *when* the hooks are executed, big-picture-wise.

tomk wrote:

btw, you can blacklist pcspkr in /etc/modprobe.conf - then you won't have to bother about it on resume.

Very nice, I didn't know about that. Thanks.

Offline

#5 2008-12-31 09:55:28

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: How to run a script after resume from disk in pm-utils

Arch wiki wrote:

The hooks in this directory will be called in alphabetic order during suspend (that's the reason their names all start with 2 digits, to make the ordering explicit) and in the reverse order during resume.

That seems clear to me. What else are you looking for?

Offline

#6 2009-01-01 02:54:15

B-Con
Member
From: USA
Registered: 2007-12-17
Posts: 554
Website

Re: How to run a script after resume from disk in pm-utils

tomk wrote:
Arch wiki wrote:

The hooks in this directory will be called in alphabetic order during suspend (that's the reason their names all start with 2 digits, to make the ordering explicit) and in the reverse order during resume.

That seems clear to me. What else are you looking for?

But pm-hibernate does some of its own work for hibernation/thawing. I'd like to know where in relation to *that* the hooks are run. Ie, during hibernation, are they run before or after the vanilla pm-hibernate functionality?

Offline

#7 2009-01-01 09:57:58

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: How to run a script after resume from disk in pm-utils

Couldn't say exactly, but module operations are handled by /usr/lib/pm-utils/sleep.d/75modules. Put the ones you need in the SUSPEND_MODULES array.

This is all covered in the wiki.

Offline

#8 2009-01-01 10:15:44

bluewind
Administrator
From: Austria
Registered: 2008-07-13
Posts: 172
Website

Re: How to run a script after resume from disk in pm-utils

Your custom hooks are merged with the default ones so they will run in between.

Offline

#9 2009-01-05 12:26:46

B-Con
Member
From: USA
Registered: 2007-12-17
Posts: 554
Website

Re: How to run a script after resume from disk in pm-utils

Ah, I see, /etc/pm/sleep.d/ is merged with /usr/lib/pm-utils/sleep.d/. I'm not sure how I missed that. Thanks for pointing out the obvious to me, guys. smile

Offline

Board footer

Powered by FluxBB