From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 8AB7F138010 for ; Tue, 25 Sep 2012 15:36:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 30E5B21C1CE; Tue, 25 Sep 2012 15:35:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0252921C1CE for ; Tue, 25 Sep 2012 15:35:22 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 41A3C33C224 for ; Tue, 25 Sep 2012 15:35:22 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 03B07E5444 for ; Tue, 25 Sep 2012 15:35:21 +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: <1348586567.5615fa78d6dc4e23662a2c4130f31b8f954a8aab.WilliamH@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: man/, sh/ X-VCS-Repository: proj/openrc X-VCS-Files: man/runscript.8 sh/runscript.sh.in X-VCS-Directories: man/ sh/ X-VCS-Committer: WilliamH X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 5615fa78d6dc4e23662a2c4130f31b8f954a8aab X-VCS-Branch: master Date: Tue, 25 Sep 2012 15:35:21 +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: 821833c1-ad6e-4fc4-9229-cece32c47a87 X-Archives-Hash: 8eaeb6413ca16a8469d8f93eb8491100 commit: 5615fa78d6dc4e23662a2c4130f31b8f954a8aab Author: William Hubbs gmail com> AuthorDate: Mon Sep 24 18:53:53 2012 +0000 Commit: William Hubbs gentoo org> CommitDate: Tue Sep 25 15:22:47 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=5615fa78 Drop restart_pre/restart_post By design, restart is hard coded to run stop followed by start along with all of the pre/post functions associated with them. Restart doesn't need its own pre/post functions since it is possible to make any function in an init script behave differently for a restart command by testing against the RC_CMD environment variable. --- man/runscript.8 | 5 ----- sh/runscript.sh.in | 22 ---------------------- 2 files changed, 0 insertions(+), 27 deletions(-) diff --git a/man/runscript.8 b/man/runscript.8 index c4119d9..471c0f1 100644 --- a/man/runscript.8 +++ b/man/runscript.8 @@ -447,11 +447,6 @@ depend() need ${_need} } -restart_pre() { - # Verify a config and abort the restart in case it's not valid - ... -} - # This function does any pre-start setup. If it fails, the service will # not be started. # If you need this function to behave differently for a restart command, diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in index 3b9a72d..6ad2ded 100644 --- a/sh/runscript.sh.in +++ b/sh/runscript.sh.in @@ -285,37 +285,15 @@ while [ -n "$1" ]; do case $1 in start|stop|status) verify_boot;; esac - - # FIXME: We may want to skip the start/stop _pre functions later - # restart_pre - if [ "${RC_CMD}" = "restart" ]; then - if [ "${1}" = "stop" -a "$(command -v "restart_pre")" = "restart_pre" ]; then - restart_pre || exit $? - fi - fi - - # Execute _pre functions if [ "$(command -v "$1_pre")" = "$1_pre" ] then "$1"_pre || exit $? fi - - # Execute the actual command/function, start, stop, ... "$1" || exit $? - - # restart_post - if [ "${RC_CMD}" = "restart" ]; then - if [ "${1}" = "start" -a "$(command -v "restart_post")" = "restart_post" ]; then - restart_post || exit $? - fi - fi - - # Execute the _post functions if [ "$(command -v "$1_post")" = "$1_post" ] then "$1"_post || exit $? fi - shift continue 2 else