[Pm-utils] [PATCH 3/6] Split out hooks that should be aux hooks.

Stefan Seyfried seife at suse.de
Fri May 16 01:53:19 PDT 2008

Victor Lowther wrote:
> This includes bluetooth handling, the ntpd part of clock handling,
> and network-manager handling.  More to come later.
> Also updates the documentation.
> ---
>  pm/HOWTO.hooks                                   |   21 +++++++--
>  pm/sleep.d/90clock                               |   54 +++++----------------
>  pm/sleep.d/{49bluetooth => bluetooth}            |    0 

>  pm/sleep.d/{10NetworkManager => network-manager} |    0 
>  pm/sleep.d/ntpd                                  |   31 ++++++++++++

I do not think that the network-manager and the ntpd hooks dont have any
ordering requirements.

> diff --git a/pm/HOWTO.hooks b/pm/HOWTO.hooks
> index 7beb1f2..ddf4044 100644
> --- a/pm/HOWTO.hooks
> +++ b/pm/HOWTO.hooks
> @@ -28,13 +28,26 @@ false -- The hook MUST perform whatever action is appropriate when the system
> -All hooks are run in lexical sort order according to the C locale.
> +Hooks are always run in one of two phases, either the core phase or
> +the aux phase.  The pm-utils infrastructure classifies hooks into
> +these two phases based on how the hooks are named.
> +
> +A hook will be classified as a core hook if the first two characters
> +of its base filename are any of the digits 0 through 9.  Any other
> +hook will be classified as an aux hook.
> +
> +When running hooks forwards, all aux hooks will run first in no
> +specified order, and when they are all finished the core hooks will
> +run in C locale lexical sort order.
> +
> +When running hooks backwards, all core hooks are run in reverse C
> +lexical sort order, then all aux hooks will run in no specified order.

Just one question: Do you think somebody who does not yet have had anything to
do with this stuff and even does not want to have anything to do with it, but
needs to write a hook for his software package, still knows when and if his
hook will run and what the outcome will be?

Remember, one of the design ideas of pm-utils, back when Peter Jones was doing
it was to keep it simple and easy, even easy to understand, both for users and
for people wanting to write a hook or a "plugin" for it.

I really think this is all going to be totally overengineered (not only this
change but all of the big overhaul that has taken place lately) and it is
defeating the original purpose.

This is one reason why i'm sticking to the old codebase: users and developers
just understand what it is doing and they like that. It is easy to explain and
bugs are easy to fix.

Have fun,

Stefan Seyfried
R&D Team Mobile Devices            |              "Any ideas, John?"
SUSE LINUX Products GmbH, Nürnberg | "Well, surrounding them's out."

This footer brought to you by insane German lawmakers:
SUSE Linux Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

More information about the Pm-utils mailing list