Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 53138 invoked from network); 30 Nov 2009 22:54:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Nov 2009 22:54:07 -0000 Received: (qmail 64842 invoked by uid 500); 30 Nov 2009 22:54:06 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 64756 invoked by uid 500); 30 Nov 2009 22:54:06 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 64747 invoked by uid 99); 30 Nov 2009 22:54:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Nov 2009 22:54:06 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Nov 2009 22:54:03 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9B17523888E8; Mon, 30 Nov 2009 22:53:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r885606 - /httpd/httpd/trunk/build/rpm/httpd.init Date: Mon, 30 Nov 2009 22:53:43 -0000 To: cvs@httpd.apache.org From: minfrin@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091130225343.9B17523888E8@eris.apache.org> Author: minfrin Date: Mon Nov 30 22:53:43 2009 New Revision: 885606 URL: http://svn.apache.org/viewvc?rev=885606&view=rev Log: 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. Modified: httpd/httpd/trunk/build/rpm/httpd.init Modified: httpd/httpd/trunk/build/rpm/httpd.init URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/build/rpm/httpd.init?rev=885606&r1=885605&r2=885606&view=diff ============================================================================== --- httpd/httpd/trunk/build/rpm/httpd.init (original) +++ httpd/httpd/trunk/build/rpm/httpd.init Mon Nov 30 22:53:43 2009 @@ -42,6 +42,9 @@ . /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 @@ # 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 @@ 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 @@ 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 @@ 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 +