Bug 1334480

Summary: running remove-ds-admin.pl multiple times will make it so you cannot install DS
Product: Red Hat Directory Server Reporter: Noriko Hosoi <nhosoi>
Component: Install/UninstallAssignee: Nathan Kinder <nkinder>
Status: CLOSED ERRATA QA Contact: Viktor Ashirov <vashirov>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.1.1CC: ekeck, msauton, nhosoi, pbokoc, spichugi, vashirov
Target Milestone: DS 9.1.2   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 389-admin-1.1.43-2.el6dsrv Doc Type: Bug Fix
Doc Text:
The "remove-ds-admin.pl" script previously attempted to reset files in the Administration Server configuration directory by removing existing, possibly customized files and moving back defaults from a backup directory which was generated before by the "setup-ds-admin.pl" script. If the "remove-ds-admin.pl" script was run repeatedly, or if it was run once without previously running "setup-ds-admin.pl", the configuration files were removed and not restored, which then caused any following attempts to run "setup-ds-admin.pl" to fail. With this update, instead of removing existing configuration files, the "remove-ds-admin.pl" only overwrites them from backup if available, and the "setup-ds-admin.pl" script can no longer fail due to missing configuration files.
Story Points: ---
Clone Of: 1302382 Environment:
Last Closed: 2016-06-08 12:10:52 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:
Bug Depends On: 1302382    
Bug Blocks:    

Description Noriko Hosoi 2016-05-09 18:11:21 UTC
+++ This bug was initially created as a clone of Bug #1302382 +++

Description of problem:
If you happen to run remove-ds-admin.pl multiple times in a row you cannot install DS.
 

Version-Release number of selected component (if applicable):
389-admin-1.1.42-1.el7dsrv.x86_64


How reproducible:
Always


Steps to Reproduce:
1. /usr/sbin/setup-ds-admin.pl --silent --file=/root/setup.inf
2. /usr/sbin/remove-ds-admin.pl -f -d -a -y
3. /usr/sbin/remove-ds-admin.pl -f -d -a -y
4. /usr/sbin/setup-ds-admin.pl --silent --file=/root/setup.inf


Actual results:
NMC_Status: 1
NMC_ErrType: 
NMC_ErrInfo: Cannot open file /etc/dirsrv/admin-serv/console.conf for reading
Could not update the httpd engine configuration.
Failed to create and configure the admin server


Expected results:
The admin server was successfully started.
Admin server was successfully created, configured, and started.
Exiting . . .


Additional info:
What is happening when you run setup-ds-admin.pl twice. It removes the 4 files

# ls -l /etc/dirsrv/admin-serv/
total 48
-rw-r--r--. 1 root root  3936 Jun  8  2015 admserv.conf
-rw-r--r--. 1 root root  4466 Jun  8  2015 console.conf
-rw-r--r--. 1 root root 26738 Jun  8  2015 httpd.conf
-rw-r--r--. 1 root root  4505 Jun  8  2015 nss.conf

and there no backup directory to copy back to /etc/dirsrv/admin-serv/. One way to handle this is.  Do not make a backup but have a direcroty with the 4 default configs and it would copy them to /etc/dirsrv/admin-serv/ before it edits them.

--- Additional comment from Marc Sauton on 2016-02-01 12:56:13 EST ---

as a workaround, re-installing 389-admin will add back the missing config files when no backup exists

--- Additional comment from Marc Sauton on 2016-02-15 12:34:46 EST ---

note I forgot to post/save last week..:
Viktor Ashirov pointed me to those known references (thanks):

bz 1229445 - [DOC -- known issue] remove-ds-admin.pl removes files in the rpm
https://bugzilla.redhat.com/show_bug.cgi?id=1229445

and
http://documentation-devel.engineering.redhat.com/site/documentation/en-US/Red_Hat_Directory_Server/10/html/Release_Notes/Release_Notes-Bugs_Addressed-Known_Issues.html

"
 If the remove-ds-admin.pl script is executed without an installed Admin server, it removes configuration files that were installed from the RPM package. As a consequence, subsequently run setup-ds-admin.pl script terminates without creating the configuration file backups. To work around this problem, run the yum reinstall 389-admin command to recover the missing files. 
"

with this workaround, GSS is trying to close the sf case number 01572443

Comment 2 Simon Pichugin 2016-06-01 16:42:44 UTC
Build tested:
389-admin-1.1.43-2.el6dsrv.x86_64

Steps to verify:
1. Install an instance with setup-ds-admin.pl
2. remove-ds-admin.pl -f -d -a -y
3. remove-ds-admin.pl -f -d -a -y
4. Install an install second time with setup-ds-admin.pl:

Result output:
...
The admin server was successfully started.
Admin server was successfully created, configured, and started.
Exiting . . .

Marking as verified.

Comment 4 errata-xmlrpc 2016-06-08 12:10:52 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://access.redhat.com/errata/RHBA-2016:1210