From f48d9c33a5c708c871d6657a39485d1c0c735548 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Tue, 25 Jul 2017 13:54:12 -0500 Subject: 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: -- cgit v1.2.3