Bug 617218 - JON241: Apache start, stop, restart, etc. operations do not pass "-d serverroot" or "-f config" command line options
JON241: Apache start, stop, restart, etc. operations do not pass "-d serverro...
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
3.0.0
All All
high Severity high (vote)
: ---
: ---
Assigned To: Lukas Krejci
Corey Welton
:
Depends On:
Blocks: jon241-bugs
  Show dependency treegraph
 
Reported: 2010-07-22 10:11 EDT by Ian Springer
Modified: 2013-08-05 20:37 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 652229 (view as bug list)
Environment:
Last Closed: 2011-05-23 21:12:19 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)
proposed patch (6.49 KB, patch)
2010-07-22 12:32 EDT, Lukas Krejci
no flags Details | Diff
corrected patch (4.20 KB, patch)
2010-07-22 12:38 EDT, Lukas Krejci
no flags Details | Diff

  None (edit)
Description Ian Springer 2010-07-22 10:11:43 EDT
This means that the httpd executable will always use the default server root (the one hard-coded in the httpd binary) and the default config file (SERVER_ROOT/conf/httpd.conf), rather than the server root and config file defined in the Resource's plugin configuration. So when those values are not the same as the default values, either the operation will fail or the wrong Apache instance will be started or stopped...
Comment 1 Lukas Krejci 2010-07-22 12:32:08 EDT
Created attachment 433755 [details]
proposed patch

This patch ensures that the -d <server-root> -f <conf-file> is always passed to the control script.
Comment 2 Lukas Krejci 2010-07-22 12:38:19 EDT
Created attachment 433758 [details]
corrected patch

I created the first patch off of wrong revisions.. This should be the correct version
Comment 3 Ian Springer 2010-07-23 13:22:12 EDT
I've reviewed Lukas's patch, and it looks good.
Comment 4 Charles Crouch 2010-07-23 13:45:29 EDT
Dropping priority since this appears to have a workaround
Comment 5 Lukas Krejci 2010-11-11 07:50:21 EST
commit f188170f3196544902cf6d19a02cb0e8d6ac8309
Author: Lukas Krejci <lkrejci@redhat.com>
Date:   Thu Jul 22 18:26:30 2010 +0200

    BZ 617218 - always passing in the -d <serverroot> -f <conf-file> as parameters to the apache control script so that a correct instance is acted upon.
Comment 6 Rajan Timaniya 2010-11-15 05:35:05 EST
Tested on JON 2.4.1 (build #23) build number: 10957:f188170

Observation:
Apache start, stop, restart, restart gracefully, operations from UI working fine.

Lukas,
Can you please provide steps to test the bug?
Comment 7 Lukas Krejci 2010-11-15 05:51:25 EST
Repro Steps:

1) Copy the default apache configuration from /etc/httpd somewhere else and make some modifications so that you can identify that server (for example change the Listen port to some other value)
2) Start that apache instance by executing:
httpd -d <the-new-location> -f <httpd.conf-in-the-new-location> -k start
3) Let RHQ discover this instance and inventory it
4) On that inventoried instance, issue all of its operations and check that the operations executed using the correct configuration files (i.e. in the above example, the server is going to listen on the port specified in the new-location configuration)

Also, a slightly more complicated scenario should be tested:

1) Have some config in the default /etc/httpd
2) Copy it to some new location
3) In the new location, change the ServerRoot to point to yet another location

In that case, the configuration specified in the yet-another-location should be used by the server and loaded by the plugin.
Comment 8 Rajan Timaniya 2010-11-15 09:48:39 EST
Tested on JON 2.4.1 (build #23) build number: 10957:f188170

Steps:
1) Copy the default apache configuration from /etc/httpd somewhere else and
make some modifications so that you can identify that server (for example
change the Listen port to some other value)
2) Start that apache instance by executing:
httpd -d <the-new-location> -f <httpd.conf-in-the-new-location> -k start
3) Let RHQ discover this instance and inventory it
4) On that inventoried instance, issue all of its operations and check that the
operations executed using the correct configuration files (i.e. in the above
example, the server is going to listen on the port specified in the
new-location configuration)

Observation:
Operations executed with its appropriate configuration files.

Still other scenario need to be tested.
Comment 9 Sunil Kondkar 2010-11-17 02:45:33 EST
Verified the second scenario on Build #23 (jon241-release/23)

1) Default config is at /etc/httpd
2) Copied it to new location    /NotBackedUp/newapache/httpd.conf
3) In the new location, changed the ServerRoot in config file to point to yet another location  --/NotBackedUp
4) In the new location, specified Listen:81 and "Include conf.d/*.conf"
5) Added a configuration file at the location defined as ServerRoot in conf file (at /NotBackedup/conf.d/test.conf)
6) Added ServerName and ServerAdmin directives in /NotBackedup/conf.d/test.conf


Observed that the configuration specified in the yet-another-location is loaded by the plugin.
The ServerAdmin and ServerName are displayed as defined in /NotBackedup/conf.d/test.conf

Also did some operations like start, stop, restart, restart gracefully on apache resource from UI. These operations are successful and executed using the correct configuration file.
(/NotBackedUp/newapache/httpd.conf )
Comment 10 Corey Welton 2011-05-23 21:12:19 EDT
Bookkeeping - closing bug - fixed in recent release.
Comment 11 Corey Welton 2011-05-23 21:12:19 EDT
Bookkeeping - closing bug - fixed in recent release.

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