Bug 114619 - /etc/rc.d/init.d/httpd is one-and-only run centric...
Summary: /etc/rc.d/init.d/httpd is one-and-only run centric...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: httpd
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-01-30 09:36 UTC by Peter Bieringer
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-04-22 14:30:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Peter Bieringer 2004-01-30 09:36:35 UTC
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 21:48:29 UTC
Internal RFE bug #114790 entered. Will be considered for future releases.

Comment 2 Suzanne Hillman 2004-04-22 14:30:10 UTC
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.