From: Graham Leggett Date: Tue, 8 Feb 2011 22:58:42 +0000 (+0000) Subject: RPM spec file: Make the httpd init script consistent with the htcacheclean X-Git-Tag: 2.2.18~151 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27c2ac862f5b6dcfeb5d505fe93c2073c5bcdce7;p=thirdparty%2Fapache%2Fhttpd.git 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1068669 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/build/rpm/httpd.init b/build/rpm/httpd.init index c9ff7c8e07a..86aabd36d04 100755 --- a/build/rpm/httpd.init +++ b/build/rpm/httpd.init @@ -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