commit:     f48d9c33a5c708c871d6657a39485d1c0c735548
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Tue Jul 25 18:54:12 2017 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Tue Jul 25 18:54:12 2017 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=f48d9c33

man/openrc-run.8: document _pre and _post functions

Fixes https://github.com/openrc/openrc/issues/155.

 man/openrc-run.8 | 12 ++++++++++++
 1 file changed, 12 insertions(+)

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:

Reply via email to