Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/openrc:master commit in: man/
Date: Tue, 25 Jul 2017 18:57:52
Message-Id: 1501008852.f48d9c33a5c708c871d6657a39485d1c0c735548.williamh@OpenRC
1 commit: f48d9c33a5c708c871d6657a39485d1c0c735548
2 Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
3 AuthorDate: Tue Jul 25 18:54:12 2017 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Tue Jul 25 18:54:12 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=f48d9c33
7
8 man/openrc-run.8: document _pre and _post functions
9
10 Fixes https://github.com/openrc/openrc/issues/155.
11
12 man/openrc-run.8 | 12 ++++++++++++
13 1 file changed, 12 insertions(+)
14
15 diff --git a/man/openrc-run.8 b/man/openrc-run.8
16 index 278aa0e1..3fb5a5b3 100644
17 --- a/man/openrc-run.8
18 +++ b/man/openrc-run.8
19 @@ -284,6 +284,18 @@ system.
20 To see how to influence dependencies in configuration files, see the
21 .Sx FILES
22 section below.
23 +.Sh _pre AND _post FUNCTIONS
24 +Any command defined in extra_commands, extra_started_commands or
25 +extra_stopped_commands can have _pre and _post functions in the service
26 +script. If the command function is called foo, the_pre and _post
27 +functions for it should be called foo_pre and foo_post.
28 +.Pp
29 +These functions should be used to perform preparation before the
30 +command is run and cleanup after the command completes. In order for
31 +.Nm
32 +to record the command as being run successfully, the _pre
33 +function, command function itself and the _post function should all exit
34 +with a zero return code.
35 .Sh BUILTINS
36 .Nm
37 defines some builtin functions that you can use inside your service scripts: