Bug 1182329

Summary: [RFE] If we turn off "User Interface" and "Web Services," Apache is still running installed.
Product: Red Hat CloudForms Management Engine Reporter: Jared Deubel <jdeubel>
Component: ApplianceAssignee: Joe Rafaniello <jrafanie>
Status: CLOSED ERRATA QA Contact: bmorriso
Severity: low Docs Contact:
Priority: high    
Version: 5.4.0CC: bkozdemb, bmorriso, dajohnso, dclarizi, jhardy, jrafanie, obarenbo, snansi, xlecauch
Target Milestone: GAKeywords: FutureFeature
Target Release: 5.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.4.0.0.11 Doc Type: Enhancement
Doc Text:
This version of CloudForms Management Engine stops and disables the Apache HTTPD service when the web user interface service is disabled. This feature enhances the safety of the services enabled by default.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-16 12:47:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 5 Joe Rafaniello 2015-02-23 20:19:56 UTC
Preliminary WIP pull request:
https://github.com/ManageIQ/manageiq/pull/1841

Comment 6 Dave Johnson 2015-03-02 19:26:50 UTC
Joe, that is all accurate although I question if we need to actually reboot the entire appliance.  Let's workaround the issue by telling the customer to disable the ui/web service roles and stop httpd service, wouldn't that be better than a full reboot?

But maybe all that is moot if we have a PR in comment 5???

Comment 7 Joe Rafaniello 2015-03-03 17:53:47 UTC
Yes, Dave, thanks!

I think I have it fixed in https://github.com/ManageIQ/manageiq/pull/1841

The workaround can be provided if needed.

Comment 8 CFME Bot 2015-03-04 16:25:52 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/d89c500d2409e63266467c92265d7a9891b94328

commit d89c500d2409e63266467c92265d7a9891b94328
Author:     Joe Rafaniello <jrafanie>
AuthorDate: Mon Feb 23 14:46:14 2015 -0500
Commit:     Joe Rafaniello <jrafanie>
CommitDate: Mon Mar 2 14:11:07 2015 -0500

    Stop apache if user_interface and web_services are inactive.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1182329

 vmdb/app/models/miq_server/environment_management.rb    | 4 ++++
 vmdb/app/models/miq_server/role_management.rb           | 6 ++++++
 vmdb/app/models/miq_server/worker_management/monitor.rb | 1 +
 3 files changed, 11 insertions(+)

Comment 9 CFME Bot 2015-03-04 16:25:56 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/26c65b6b7f305c3e9785f4b9ca7fa2d86b14d186

commit 26c65b6b7f305c3e9785f4b9ca7fa2d86b14d186
Author:     Joe Rafaniello <jrafanie>
AuthorDate: Mon Mar 2 15:38:23 2015 -0500
Commit:     Joe Rafaniello <jrafanie>
CommitDate: Mon Mar 2 16:28:22 2015 -0500

    Make apache_needed? easier to read.
    
    Array set operations with the non-empty check is faster but not easy to read.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1182329

 vmdb/app/models/miq_server/role_management.rb       |  4 +++-
 vmdb/spec/models/miq_server/role_management_spec.rb | 17 +++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

Comment 10 CFME Bot 2015-03-04 16:26:00 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/79456a6c3c2f5b3bef31f40b76b89cdaa72be248

commit 79456a6c3c2f5b3bef31f40b76b89cdaa72be248
Author:     Joe Rafaniello <jrafanie>
AuthorDate: Mon Mar 2 17:27:52 2015 -0500
Commit:     Joe Rafaniello <jrafanie>
CommitDate: Mon Mar 2 17:51:32 2015 -0500

    Track all of the ports added/deleted but only restart httpd for adds.
    
    Previously, we only saved the load balancer configuration and the registered_ports
    when adding ports.  This prevented having to hit the filesystem to save the config file
    but caused us to not track when the user_interface and webservices roles are removed.
    
    We need to track when the roles are added/removed so we can start/stop httpd.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1182329

 vmdb/app/models/mixins/web_server_worker_mixin.rb | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comment 11 Joe Rafaniello 2015-03-04 16:32:17 UTC
QE, we now stop apache when BOTH user_interface and web_services roles are not active.

https://github.com/ManageIQ/manageiq/blob/a7c25182a1e935c108c8692df664cbc7351d2a9d/vmdb/db/fixtures/server_roles.csv#L22-24

Additionally, we START apache as soon as either user_interface or web_services is active.

Users can now expect httpd to never run if they don't enable either of these roles.

Comment 13 bmorriso 2015-04-15 15:20:27 UTC
Verified working in 5.4.0.0.19.20150410165622_ad23806.

Verification Steps:
1. Deploy two appliances: appl1 (Internal DB), appl2 (connected to DB on appl1)
2. From appl1's WebUI, disable the Web Services and User Interface roles on appl2.
3. SSH into appl2 and confirm httpd service is off. 
4. From appl1's WebUI, re-enable Web Services and User Interface roles on appl2. 
5. SSH into appl2 and confirm httpd service is on again.

Comment 15 errata-xmlrpc 2015-06-16 12:47:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1100.html