[Pm-utils] Move pm/functions and hooks to /usr/lib or /usr/share

Tim Dijkstra newsuser at famdijkstra.org
Sat Mar 10 11:41:39 PST 2007


On Fri, 9 Mar 2007 16:53:48 +0100
Stefan Seyfried <seife at suse.de> wrote:

> Hi,
> 
> [i agree with everything in this thread to which i did not
>  explicitly object] :-)
> 
> On Tue, Mar 06, 2007 at 12:37:13AM +0100, Holger Macht wrote:
> > On Tue 06. Mar - 00:21:56, Michael Biebl wrote:
> > > The problem about the hooks is, that they are activated/deactivated
> > > via the x-bit. It would be a bit odd to have to change the x bit of a
> > > file in /usr/lib/pm.
> > > 
> > > Maybe using symlinks would be a better idea anyway, similar to /etc/init.d
> > 
> > I think this sounds reasonable. Something like a symlink from
> > /etc/pm/hooks to /usr/lib/pm/hooks or the like?
> 
> no, more like:
> 
> /etc/pm/{hooks,sleep.d}/ having links
> 01foo -> /usr/lib/pm/hooks/foo
> 05bar -> /usr/lib/pm/hooks/bar
> 99baz -> /usr/lib/pm/hooks/baz
> 
> So you add a link -> enable the hook
> rm the link -> disable the hook
> 
> It is even more intuitive than the "set the x bit to enable, remove it to
> disable" IMO.
> The cream topping will be if somebody writes a "chkconfig" style hook-enable-
> and-reorder-tool :-)

That is something I want to avoid. It will going to give me packaging
nightmares. From a debian perspective it is much easier to have a
scheme such as Peter proposed: Packages install in 
/usr/lib/pm/{sleep,config,power}.d this are the scripts everybody 
needs. They will be overridden on every upgrade. The user (administrator) 
can put his local stuff in /etc/pm, the packages won't touch that.
At execution time the contents of both directories will get merged 
and sorted. If there is a possibility somebody doesn't want a certain
script to be started it will have to get a config option.

grts Tim


More information about the Pm-utils mailing list