Re: [gpm] Exec a command before and after suspeding



On Sat, 2006-12-16 at 12:14 +0000, Richard Hughes wrote:
> On Wed, 2006-12-13 at 11:52 -0500, Peter Jones wrote:
> > On Wed, 2006-12-13 at 13:29 +0100, Frittella Laurento wrote:
> > > Can g-p-m exec a custom command before and after suspend without root
> > > privileges?
> > > If I use OnSuspend and OnResume in the hibernate configuration the
> > > command will start with root privileges and it doesn't work as it should
> > > (I want to interact with some applications using the DBus session of the
> > > user that runs g-p-m).
> > 
> > We don't really have any infrastructure for that yet, unfortunately.
> > Probably the easiest thing to do is something like what I've done in
> > http://people.redhat.com/pjones/rhythmbox-pm.tar.bz2
> 
> Peter, shouldn't we just implement the suspend registration interface,
> or just send a signal on suspend or resume? Doing this system wide seems
> the wrong thing to do.

(sorry for the super-late reply :/ )

Yes, an interface to register "please tell me when we're going to
suspend or have resumed" is probably the right thing.  In fact, the dbus
stuff in that tarball is essentially that, with names specific to
rhythmbox.

That solves part of the problem, and it's probably the 90% solution we
should go with, but it doesn't solve the general problem -- which is
basically user-definable, per-session hooks.  I don't think that's
really worth trying very hard at, but if anybody really wants it, it
takes about 40 lines of python if we've got the interface discussed
above.

-- 
  Peter




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]