aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2012-09-24 13:53:53 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2012-09-25 10:22:47 -0500
commit5615fa78d6dc4e23662a2c4130f31b8f954a8aab (patch)
treee52216098b645bafc1879ad7f94200560b9f69e8 /sh
parentf007988fbac79460f7733eb9093d2beb537311f8 (diff)
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.
Diffstat (limited to 'sh')
-rw-r--r--sh/runscript.sh.in22
1 files changed, 0 insertions, 22 deletions
diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in
index 3b9a72d6..6ad2ded3 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