summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-03-11 17:29:29 -0500
committerVictor Lowther <victor.lowther@gmail.com>2008-03-11 17:29:29 -0500
commitdce01897081f9c23b3b33ed600b4190ac91f8ee3 (patch)
tree362d9a0613bbb32d79ff05fb1ec6294a5a399e4d
parent0978de0966987eb2426cfdb3a78d77eca7c4ed98 (diff)
parent02685b1ea67e656c646f8bcbad6645df08441ee5 (diff)
Merge branch 'vlowther-dynamic-hook-disable' into vlowther-default-parameters
-rw-r--r--pm/HOWTO.hooks54
1 files changed, 32 insertions, 22 deletions
diff --git a/pm/HOWTO.hooks b/pm/HOWTO.hooks
index 0ce10de..4e6cebc 100644
--- a/pm/HOWTO.hooks
+++ b/pm/HOWTO.hooks
@@ -39,25 +39,35 @@ For any given sleep/wakeup cycle, the hooks in sleep.d are run twice:
CONVENIENCE FUNCTIONS
If your hook is a shell script that supports POSIX/SuS compatible syntax, you
-MAY source /usr/lib/pm-utils/functions, which will perform the following
-actions:
-
-1: All settings present in the files located in /etc/pm/config.d/ will be
- available as environment variables.
-2: The following convenience functions will be made available:
- 1: try_lock
- 2: spin_lock
- 3: release_lock
- 4: get_power_status
- 5: modunload
- 6: modreload
- 7: stopservice
- 8: restartservice
- 9: savestate
- 10: restorestate
- To get an overview of what each of those functions does and the parameters
- they accept, read the fine source. Note that other functions may be
- present -- those functions are internal to the pm-utils package and MUST NOT
- be used by external hooks. In the future, those functions will not be
- available to third-party hooks.
-
+MAY source /usr/lib/pm-utils/functions, which will make the following
+convenience functions available:
+1: try_lock
+ try_lock expects a single parameter -- the name of the lock to
+ try to acquire. Exit code denotes success.
+2: spin_lock
+ Wrapper around try_lock. Second parameter is the number of seconds
+ to wait for the lock before giving up. If no second parameter
+ is passed, this function will wait forever.
+3: release_lock
+ Release a previously acquired lock. First parameter is the name of the
+ lock.
+4: get_power_status
+ Outputs our power source on stdout.
+5: modunload
+ Unload a module. Exit code denotes success.
+6: modreload
+ Reload all the modules unloaded by modunload.
+7: stopservice
+ Stop a service. First parameter is the name of the service to stop.
+8: restartservice
+ Restart a service. Service must have been stopped by stopservice.
+9: savestate
+ Save state piped into this function on stdin. First parameter is the
+ name of the state being saved. If a second parameter is passed, this
+ function will use it instead of stdin.
+10: restorestate
+ Outputs state saved by savestate on stdout. The first parameter is the
+ name of the state to restore.
+11: disablehook
+ Prevent a hook from running. The exact name of the hook (including
+ numberic prefix) must be passed.