[ltp] Re: initial state vs. state transitions

David Abrahams linux-thinkpad@linux-thinkpad.org
Tue, 30 Dec 2008 07:59:34 -0900


on Tue Dec 30 2008, Henrique de Moraes Holschuh <hmh-AT-hmh.eng.br> wrote:

> On Mon, 29 Dec 2008, David Abrahams wrote:
>> on Mon Dec 29 2008, Henrique de Moraes Holschuh <hmh-AT-hmh.eng.br> wrote:
>> > On Mon, 29 Dec 2008, David Abrahams wrote:
>> >> Does this setting of the initial state trigger acpi or pm state
>> >> transition hooks?
>> >
>> > No, and it wouldn't help that much, for various reasons, the main one
>> > being that it is hard to get this right, and applications would still
>> > need to do special processing to request the first event, and to wait
>> > for it before doing anything else.
>> 
>> I'm not sure what "applications" means in this context.  I'm talking
>> about the sort of things that typically get installed in
>> /etc/pm/power.d, /etc/acpi, and /etc/udev
>
> Applications in this context means "something you wanted to do with a single
> script, but now I am telling you you need at least two ;-)".
>
>> [By the way, it's almost impossible for me to keep track of these
>> different mechanisms, and they seem to be proliferating.  Is there
>> somewhere a guide that ties them all together conceptually?]
>
> Yes: HAL.   You can do all the ACPI and uevent processing in HAL, it listens
> to both.

Including the /etc/pm stuff?

>> >> My concern is that to say "put the system in state X when on battery
>> >> power" seems t require installing a transition hook and... something
>> >> else.  What, I am not sure.
>> >
>> > I personally go with initscripts, because I do like these things to be
>> > tied to the system and acpid.  
>> 
>> Wow, yet another pathway.  I am familiar with initscripts but in my
>> experience they usually start and stop server processes.  How would I
>> use initscripts with power transitions, etc.?  Or are you suggesting
>> that initscripts are just used to handle startup states?  Then what
>> about transitions out of suspend/hibernate?  Should I really be
>> installing *three* sets of hooks?
>
> I use initscripts to handle startup states.  And yes, you may end up needing
> the THREE sets of hooks you mentioned :(

Fabuless.

At least now I know I wasn't missing something.  Thanks again for your help.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com