From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1C7E0139694 for ; Tue, 25 Jul 2017 18:57:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6EB81E0DF3; Tue, 25 Jul 2017 18:57:51 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4CBC6E0DF3 for ; Tue, 25 Jul 2017 18:57:51 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5326A3417DA for ; Tue, 25 Jul 2017 18:57:50 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id EB077291E for ; Tue, 25 Jul 2017 18:57:48 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1501008852.f48d9c33a5c708c871d6657a39485d1c0c735548.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: man/ X-VCS-Repository: proj/openrc X-VCS-Files: man/openrc-run.8 X-VCS-Directories: man/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: f48d9c33a5c708c871d6657a39485d1c0c735548 X-VCS-Branch: master Date: Tue, 25 Jul 2017 18:57:48 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 06051697-dd0c-4465-8c0d-2b0a433e6b6b X-Archives-Hash: fca5af6d37100bafb4fc5ea133325c0d commit: f48d9c33a5c708c871d6657a39485d1c0c735548 Author: William Hubbs gmail com> AuthorDate: Tue Jul 25 18:54:12 2017 +0000 Commit: William Hubbs gentoo 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: