[Pm-utils] Re: pm-utils' 55battery: WTF?

Holger Macht hmacht at suse.de
Wed Mar 14 09:17:31 PDT 2007

On Wed 14. Mar - 12:13:39, David Zeuthen wrote:
> On Wed, 2007-03-14 at 12:05 -0400, Peter Jones wrote:
> > On Wed, 2007-03-14 at 13:56 +0100, Olivier Blin wrote:
> > > David Zeuthen <david at fubar.dk> writes:
> > > > It tells HAL to rescan the battery - in case someone changed the battery
> > > > we want the new serial number etc... if I recall Peter's reasoning
> > > > correctly. I think this check is better done in HAL than in pm-utils; it
> > > > doesn't make sense to make pm-utils call into HAL at all - Peter, is
> > > > this fine with you? 
> > > 
> > > But what if pm-hibernate is run directly from command line and not
> > > from hal-system-power-hibernate-linux ?
> > > Or do you forget about command line users in pm-utils?
> > 
> > Yeah, that's certainly a valid point.  I think that we really should be
> > (as bizarre as it seems) telling HAL when we're suspending and when
> > we're resuming.
> > 
> > David, what do you think about this?
> I kinda don't like that idea. The fact we need to rescan some devices is
> simply just a bug with the kernel and I don't like introducing new deps
> because of bugs. 
> Keep in mind too that suspending the box normally originates from the
> desktop session power management daemon and in the future programs can
> register with said daemon to be able to run hooks (for e.g. setting
> away / signing off IRC) just before the suspend is initiated. 
> For the record, I'd much rather that pm-suspend went away (e.g. moved
> into /usr/sbin) and command line users started used something like
> xdg-suspend (that don't exist yet, but look at Portland) to poke the
> desktop session power management daemon via e.g. the mythical
> o.fd.PowerManagement D-Bus session bus interface (that we _still_
> haven't standardized on). Notably this command could fall back to poking
> HAL for the really bizarre use cases where you're not running in a
> desktop session.

That's basically what we've done in openSUSE after the transition from the
powersave daemon towards HAL and pm-utils. The old powersave command line
client has become the policy agent for users on the command line or for
servers where you don't have kpowersave or gnome-power-manager. I'm
advertising to run 'powersave -u/-U' instead of pm-suspend/pm-hibernate to
our users all the time, and the powersave binary cares about the policy
and calls HAL's suspend/hibernate method in the end.


More information about the Pm-utils mailing list