You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2011/02/08 23:51:31 UTC

svn commit: r1068660 - /httpd/httpd/trunk/build/rpm/httpd.init

Author: minfrin
Date: Tue Feb  8 22:51:31 2011
New Revision: 1068660

URL: http://svn.apache.org/viewvc?rev=1068660&view=rev
Log:
RPM spec file: Make the httpd init script consistent with the htcacheclean
init script. Multiple daemons can be started by creating symlinks to the
init script.

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=1068660&r1=1068659&r2=1068660&view=diff
==============================================================================
--- httpd/httpd/trunk/build/rpm/httpd.init (original)
+++ httpd/httpd/trunk/build/rpm/httpd.init Tue Feb  8 22:51:31 2011
@@ -38,8 +38,12 @@
 # Source function library.
 . /etc/rc.d/init.d/functions
 
-if [ -f /etc/sysconfig/httpd ]; then
-        . /etc/sysconfig/httpd
+# What were we called? Multiple instances of the same daemon can be
+# created by creating suitably named symlinks to this startup script
+prog=$(basename $0 | sed -e 's/^[SK][0-9][0-9]//')
+
+if [ -f /etc/sysconfig/${prog} ]; then
+        . /etc/sysconfig/${prog}
 fi
 
 # Start httpd in the C locale by default.
@@ -54,9 +58,8 @@ INITLOG_ARGS=""
 # work correctly with a thread-based MPM; notably PHP will refuse to start.
 
 httpd=${HTTPD-/usr/sbin/httpd}
-prog=httpd
-pidfile=${PIDFILE-/var/log/httpd/httpd.pid}
-lockfile=${LOCKFILE-/var/lock/subsys/httpd}
+pidfile=${PIDFILE-/var/log/httpd/${prog}.pid}
+lockfile=${LOCKFILE-/var/lock/subsys/${prog}}
 RETVAL=0
 
 # check for 1.3 configuration