Bug 617218 - JON241: Apache start, stop, restart, etc. operations do not pass "-d serverroot" or "-f config" command line options
Summary: JON241: Apache start, stop, restart, etc. operations do not pass "-d serverro...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 3.0.0
Hardware: All
OS: All
high
high
Target Milestone: ---
: ---
Assignee: Lukas Krejci
QA Contact: Corey Welton
URL:
Whiteboard:
Depends On:
Blocks: jon241-bugs
TreeView+ depends on / blocked
 
Reported: 2010-07-22 14:11 UTC by Ian Springer
Modified: 2018-10-27 16:17 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 652229 (view as bug list)
Environment:
Last Closed: 2011-05-24 01:12:19 UTC
Embargoed:


Attachments (Terms of Use)
proposed patch (6.49 KB, patch)
2010-07-22 16:32 UTC, Lukas Krejci
no flags Details | Diff
corrected patch (4.20 KB, patch)
2010-07-22 16:38 UTC, Lukas Krejci
no flags Details | Diff

Description Ian Springer 2010-07-22 14:11:43 UTC
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 16:32:08 UTC
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 16:38:19 UTC
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 17:22:12 UTC
I've reviewed Lukas's patch, and it looks good.

Comment 4 Charles Crouch 2010-07-23 17:45:29 UTC
Dropping priority since this appears to have a workaround

Comment 5 Lukas Krejci 2010-11-11 12:50:21 UTC
commit f188170f3196544902cf6d19a02cb0e8d6ac8309
Author: Lukas Krejci <lkrejci>
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 10:35:05 UTC
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 10:51:25 UTC
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 14:48:39 UTC
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 07:45:33 UTC
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-24 01:12:19 UTC
Bookkeeping - closing bug - fixed in recent release.

Comment 11 Corey Welton 2011-05-24 01:12:19 UTC
Bookkeeping - closing bug - fixed in recent release.


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