Bug 114619 - /etc/rc.d/init.d/httpd is one-and-only run centric...
/etc/rc.d/init.d/httpd is one-and-only run centric...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: httpd (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-01-30 04:36 EST by Peter Bieringer
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-04-22 10:30:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Peter Bieringer 2004-01-30 04:36:35 EST
Description of problem:
Think about the case on one machine for security reasons, different
http d server are running with different user/group and server root
settings. It would be great if the provided package can be used
without modifications (because of the update reason). Currently, it
doesn't fit without some modifications.

Version-Release number of selected component (if applicable):
httpd-2.0.46-26.ent

How reproducible:
Always

Steps to Reproduce:
1. create a new initscript /etc/rc.d/init.d/httpd-wwwtest with
following content:

#!/bin/bash
#
# Startup script for the Apache Web Server "wwwtest"
#
# chkconfig: - 85 15
# description: Apache is a World Wide Web server.  It is used to serve \
#              HTML files and CGI.
# processname: httpd
# pidfile: /var/run/httpd-wwwtest.pid
# config: /home/webservers/wwwtest/httpd/conf/httpd.conf

# Set options for this webserver
OPTIONS="-d /path/to/wwwtest/httpd -f
/path/to/wwwtest/httpd/conf/httpd.conf"

# Export variables
export OPTIONS

/etc/rc.d/init.d/httpd $1
exit $?


2. Start the additional server -> ok

3. Stop the additional server

Actual Results:  All other running httpd servers will be killed, too.

Expected Results:  All other httpd servers are still running

Additional info:

This can be easily made with following extension:

1: improve initscript (btw: see also fix on the "apachectl" call)

--- httpd       26 Jan 2004 15:28:49 -0000      1.1
+++ httpd       30 Jan 2004 09:36:15 -0000
@@ -30,6 +30,10 @@
 prog=httpd
 RETVAL=0

+# lock and pid files
+[ -z "$lockfile" ] && lockfile="/var/lock/subsys/httpd"
+[ -z "$pidfile" ] && lockfile="/var/run/httpd.pid"
+
 # check for 1.3 configuration
 check13 () {
        CONFFILE=/etc/httpd/conf/httpd.conf
@@ -56,7 +60,7 @@
         daemon $httpd $OPTIONS
         RETVAL=$?
         echo
-        [ $RETVAL = 0 ] && touch /var/lock/subsys/httpd
+        [ $RETVAL = 0 ] && touch $lockfile
         return $RETVAL
 }
 stop() {
@@ -64,7 +68,7 @@
        killproc $httpd
        RETVAL=$?
        echo
-       [ $RETVAL = 0 ] && rm -f /var/lock/subsys/httpd /var/run/httpd.pid
+       [ $RETVAL = 0 ] && rm -f $lockfile $pidfile
 }
 reload() {
        echo -n $"Reloading $prog: "
@@ -91,7 +95,7 @@
        start
        ;;
   condrestart)
-       if [ -f /var/run/httpd.pid ] ; then
+       if [ -f $pidfile ] ; then
                stop
                start
        fi
@@ -100,7 +104,7 @@
         reload
        ;;
   graceful|help|configtest|fullstatus)
-       $apachectl $@
+       $apachectl $OPTIONS $@
        RETVAL=$?
        ;;
   *)



2: extend caller script:

# Set special softlink for the apache
HTTPD="/usr/local/sbin/httpd-wwwtest"

# Set lock and pid file
lockfile="/var/run/httpd-wwwtest.pid"
pidfile="/var/lock/subsys/httpd-wwwtest"

# Export variables
export HTTPD lockfile pidfile


3: create a softlink:
# ln -s /usr/sbin/httpd /usr/local/sbin/httpd-wwwtest

(required for "status" and "killproc")
Even better would be if "status" and "killproc" only rely to pid file
(if possible)
Comment 1 Suzanne Hillman 2004-02-02 16:48:29 EST
Internal RFE bug #114790 entered. Will be considered for future releases.
Comment 2 Suzanne Hillman 2004-04-22 10:30:10 EDT
Thank you for the suggestion. It was passed along to product
management, but not committed for a future release.

Note You need to log in before you can comment on or make changes to this bug.