Hi Phi, I think the failure of "pgrep -f -P 1 gnome-power-manager" is because gnome-power-manager is not daemonized now. So the ppid of gpm is not 1 any more. This change is imported by fix for bug 524962 (http://bugzilla.gnome.org/show_bug.cgi?id=524962)
Another thing you need to notice when fixing this problem is compatibility with virtual console support. When multiple session is started, several gpm may be running at the same time. Regards, Jedy On Wed, 2009-03-11 at 23:05 -0700, Phi Tran wrote: > Jedy Wang wrote: > > Hi Phi, > > > > On my system, 'pgrep -f gnome-power-manager' returns the pid of > > gnome-power-manager. > > Yes, that works, but it will also pick up the pid of someone doing > "vi gnome-power-manager.dbg" :) > > Phi > > > > > Regards, > > > > Jedy > > On Wed, 2009-03-11 at 22:47 -0700, Phi Tran wrote: > >> "pgrep gnome-power-manager" doesn't work so I searched using "pgrep -f > >> -P 1 gnome-power-manager". Without the -f option, pgrep compares to > >> the > >> execuatable name in psinfo, but psinfo doesn't have the entire name, > >> just "gnome-power-man". I thought matching to the init PPID was more > >> unique than "pgrep gnome-power-man" since another executable could > >> possibly start with that string. It's probably unlikely that another > >> executable will start with "gnome-power-man" so maybe that > >> is a good enough fix. > >> > >> Phi > >> > > >