summaryrefslogtreecommitdiffstats
path: root/build/rpm
diff options
context:
space:
mode:
authorGraham Leggett <minfrin@apache.org>2009-11-30 23:53:43 +0100
committerGraham Leggett <minfrin@apache.org>2009-11-30 23:53:43 +0100
commit1dafd478fb53abd96c171e0c53d3b0e485073a87 (patch)
treed686f170c4699c1d74892334751e39e047ec8db1 /build/rpm
parentupdate transformation (diff)
downloadapache2-1dafd478fb53abd96c171e0c53d3b0e485073a87.tar.xz
apache2-1dafd478fb53abd96c171e0c53d3b0e485073a87.zip
Rpm package: pass the HTTPD_LANG variable to the httpd process in line
with Fedora. Remove the use of the apachectl script, as a script calling another script makes no sense. Test for the pidfile specifically, so that Redhat's scripts don't fall back to using pidof and returning the status of other httpd processes running on the same box. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@885606 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build/rpm')
-rwxr-xr-xbuild/rpm/httpd.init37
1 files changed, 25 insertions, 12 deletions
diff --git a/build/rpm/httpd.init b/build/rpm/httpd.init
index 5352127027..2558a52677 100755
--- a/build/rpm/httpd.init
+++ b/build/rpm/httpd.init
@@ -42,6 +42,9 @@ if [ -f /etc/sysconfig/httpd ]; then
. /etc/sysconfig/httpd
fi
+# Start httpd in the C locale by default.
+HTTPD_LANG=${HTTPD_LANG-"C"}
+
# This will prevent initlog from swallowing up a pass-phrase prompt if
# mod_ssl needs a pass-phrase from the user.
INITLOG_ARGS=""
@@ -50,8 +53,6 @@ INITLOG_ARGS=""
# with the thread-based "worker" MPM; BE WARNED that some modules may not
# work correctly with a thread-based MPM; notably PHP will refuse to start.
-# Path to the apachectl script, server binary, and short-form for messages.
-apachectl=/usr/sbin/apachectl
httpd=${HTTPD-/usr/sbin/httpd}
prog=httpd
pidfile=${PIDFILE-/var/log/httpd/httpd.pid}
@@ -81,7 +82,7 @@ check13 () {
start() {
echo -n $"Starting $prog: "
check13 || exit 1
- daemon --pidfile=${pidfile} $httpd $OPTIONS
+ LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch ${lockfile}
@@ -111,15 +112,20 @@ case "$1" in
stop
;;
status)
- status -p ${pidfile} $httpd
- RETVAL=$?
- ;;
+ if ! test -f ${pidfile}; then
+ echo $prog is stopped
+ RETVAL=3
+ else
+ status -p {$pidfile} $httpd
+ RETVAL=$?
+ fi
+ ;;
restart)
stop
start
;;
condrestart)
- if status -p ${pidfile} $httpd >&/dev/null; then
+ if test -f ${pidfile} && status -p ${pidfile} $httpd >&/dev/null; then
stop
start
fi
@@ -127,13 +133,20 @@ case "$1" in
reload)
reload
;;
- graceful|help|configtest|fullstatus)
- $apachectl $@
- RETVAL=$?
- ;;
+ configtest)
+ LANG=$HTTPD_LANG $httpd $OPTIONS -t
+ RETVAL=$?
+ ;;
+ graceful)
+ echo -n $"Gracefully restarting $prog: "
+ LANG=$HTTPD_LANG $httpd $OPTIONS -k $@
+ RETVAL=$?
+ echo
+ ;;
*)
- echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}"
+ echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|graceful|help|configtest}"
exit 1
esac
exit $RETVAL
+