From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/openrc:master commit in: man/, sh/
Date: Tue, 25 Sep 2012 15:35:21 +0000 (UTC) [thread overview]
Message-ID: <1348586567.5615fa78d6dc4e23662a2c4130f31b8f954a8aab.WilliamH@OpenRC> (raw)
commit: 5615fa78d6dc4e23662a2c4130f31b8f954a8aab
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Mon Sep 24 18:53:53 2012 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> 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
next reply other threads:[~2012-09-25 15:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-25 15:35 William Hubbs [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-09-16 19:27 [gentoo-commits] proj/openrc:master commit in: man/, sh/ William Hubbs
2012-09-22 14:58 Christian Ruppert
2012-03-03 15:24 William Hubbs
2012-01-17 17:26 Christian Ruppert
2011-12-31 1:42 Christian Ruppert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1348586567.5615fa78d6dc4e23662a2c4130f31b8f954a8aab.WilliamH@OpenRC \
--to=williamh@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox