[Pm-utils] Re: Better integration with power management scripts

Stefan Seyfried seife at suse.de
Thu Apr 27 04:28:17 PDT 2006

On Thu, Apr 27, 2006 at 11:53:29AM +0100, Matthew Garrett wrote:
> If the suspend process takes long enough that people need notification, 
> then we've already lost. I'd prefer to design something that makes the 
> assumption we can reach the correct solution, rather than designing 
> something that encourages people to think that the wrong solution is 
> good enough (see also removing modules before suspend - I've already 
> learned from that one)

The problem is that you will always have the odd out-of-tree driver that
needs to be unloaded to be able to suspend. Yes, life would be better if
that was not the case, but it is not and i do not see that it will not be
anytime soon.

So the fact is (imo): we need to be able to unload modules and unloading
may fail. Instead of just silently failing the suspend or just continuing
but then failing to resume, i'd like to tell my users what went wrong and
why. Hence we need a way to communicate.
The same applies (to a lesser extent) to stopping services.

> Please, let's make a distinction between mechanism and policy. Policy 
> ("Do you want to suspend?", "Critical battery level reached, I'm 
> hibernating now", "Suspend inhibited by cdrecord application" and so on) 
> should live in one place, and mechanism (suspending devices, putting the 
> machine to sleep) should live in another. Right now, hal provides 
> mechanism and powersaved and gnome-power-manager provide policy. Keeping 
> the line distinct makes it easy to implement new policy on top of 
> existing mechanism. Putting policy in hal would be an error, and putting 
> mechanism in the policy daemon would make life generally more 
> complicated.

This is probably ok, (i need to think about it a bit, coming from 
powersaved which implements both policy and mechanism this is quite
different, but i think we can make it work here, too), but the mechanisms
should then be fine-grained enough to let the policy-implementing frontend
really decide what is going on.

If we only get 2 methods in the end "suspend to RAM" and "suspend to disk",
i think this would not be sufficient for implementing a satisfactory user-
Stefan Seyfried                  \ "I didn't want to write for pay. I
QA / R&D Team Mobile Devices      \ wanted to be paid for what I write."
SUSE LINUX Products GmbH, Nürnberg \                    -- Leonard Cohen

More information about the Pm-utils mailing list