aboutsummaryrefslogtreecommitdiff
path: root/man/openrc-run.8
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2017-07-25 13:54:12 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2017-07-25 13:54:12 -0500
commitf48d9c33a5c708c871d6657a39485d1c0c735548 (patch)
treeda8bfac500bffb9cb9bb641f44030e93a44e9664 /man/openrc-run.8
parent6d4e8433974fd8567885635ae0454031290f96b1 (diff)
man/openrc-run.8: document _pre and _post functions
Fixes https://github.com/openrc/openrc/issues/155.
Diffstat (limited to 'man/openrc-run.8')
-rw-r--r--man/openrc-run.812
1 files changed, 12 insertions, 0 deletions
diff --git a/man/openrc-run.8 b/man/openrc-run.8
index 278aa0e1..3fb5a5b3 100644
--- a/man/openrc-run.8
+++ b/man/openrc-run.8
@@ -284,6 +284,18 @@ system.
To see how to influence dependencies in configuration files, see the
.Sx FILES
section below.
+.Sh _pre AND _post FUNCTIONS
+Any command defined in extra_commands, extra_started_commands or
+extra_stopped_commands can have _pre and _post functions in the service
+script. If the command function is called foo, the_pre and _post
+functions for it should be called foo_pre and foo_post.
+.Pp
+These functions should be used to perform preparation before the
+command is run and cleanup after the command completes. In order for
+.Nm
+to record the command as being run successfully, the _pre
+function, command function itself and the _post function should all exit
+with a zero return code.
.Sh BUILTINS
.Nm
defines some builtin functions that you can use inside your service scripts: