Bug 746078

Summary: ipa-server-install does not clean after itself
Product: Red Hat Enterprise Linux 6 Reporter: Martin Kosek <mkosek>
Component: ipaAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2CC: dpal, jgalipea, mkosek, nsoman
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-2.2.0-1.el6 Doc Type: Bug Fix
Doc Text:
No documentation needed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 13:15:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 756082    

Description Martin Kosek 2011-10-13 20:16:21 UTC
Description of problem:

Under some circumstances we update some files (/etc/hosts/ in that case) before the actual installation begins. If the user then interrupts the installation after the change the actual installation starts, he may be surprised that he ends up with partially configured system.

This means that he has to run ipa-server-install --uninstall before he can run ipa-server-install again.

Version-Release number of selected component (if applicable):

ipa-server-2.1.1-101.20111004T0103zgita013597.el6.x86_64

How reproducible:

Run ipa-server-install so that /etc/hosts is updated (this happens when the hostname is not resolvable and we install with --setup-dns or --no-host-dns):

# ipa-server-install -p secret123 -a secret123 --setup-dns --forwarder=1.2.3.4 --hostname=ipa.example.com

The log file for this installation can be found in /var/log/ipaserver-install.log
==============================================================================
This program will set up the IPA Server.

This includes:
  * Configure the Network Time Daemon (ntpd)
  * Create and configure an instance of Directory Server
  * Create and configure a Kerberos Key Distribution Center (KDC)
  * Configure Apache (httpd)
  * Configure DNS (bind)

To accept the default shown in brackets, press the Enter key.

Existing BIND configuration detected, overwrite? [no]: y
Enter the fully qualified domain name of the computer
on which you're setting up server software. Using the form
<hostname>.<domainname>
Example: master.example.com.


Server host name [ipa.example.com]: 

Warning: The host name 'ipa.example.com' does not match the system host name 'vm-063.idm.lab.bos.redhat.com'.
         Some services may not work properly.
Warning: skipping DNS resolution of host ipa.example.com
The domain name has been calculated based on the host name.

Please confirm the domain name [example.com]: 

Unable to resolve IP address for host name
Please provide the IP address to be used for this host name: 10.16.78.63
Adding [10.16.78.63 ipa.example.com] to your /etc/hosts file
The IPA Master Server will be configured with
Hostname:    ipa.example.com
IP address:  10.16.78.63
Domain name: example.com

The kerberos protocol requires a Realm name to be defined.
This is typically the domain name converted to uppercase.

Please provide a realm name [EXAMPLE.COM]: [CTRL+C] was hit
Cleaning up...

Now, we cannot run installer again.

# ipa-server-install 

The log file for this installation can be found in /var/log/ipaserver-install.log
IPA server is already configured on this system.
If you want to reinstall the IPA server please uninstall it first.


Steps to Reproduce:
1. ipa-server-install -p secret123 -a secret123 --setup-dns --forwarder=1.2.3.4 --hostname=ipa.example.com
2. Interrupt the wizard after the IP address is passed to the installer (see example above)
3. Try running ipa-server-install again
  
Actual results:
You have to run ipa-server-install --uninstall before you can try installing again

Expected results:
ipa-server-install cleans up /etc/hosts  if the installation was interrupted or exited with an error before it actually started configuring services so that user can execute a second run of ipa-server-install without need of uninstalling it first.

Additional info:

Comment 1 Martin Kosek 2011-10-13 20:17:45 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/1980

Comment 4 Namita Soman 2012-03-23 13:28:47 UTC
Verified using ipa-server-2.2.0-4.el6.x86_64

Steps taken:
Installed using hostname
verified that/etc/hosts was updated
then ctrl+c and aborted install
verified /etc/hosts was restored
Was able to reinstall successfully

Comment 6 Martin Kosek 2012-04-18 20:23:39 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No documentation needed.

Comment 8 errata-xmlrpc 2012-06-20 13:15:19 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.

http://rhn.redhat.com/errata/RHBA-2012-0819.html