Bug 1302382

Summary: running remove-ds-admin.pl multiple times will make it so you cannot install DS
Product: Red Hat Directory Server Reporter: Eugene Keck <ekeck>
Component: Install/UninstallAssignee: Noriko Hosoi <nhosoi>
Status: CLOSED ERRATA QA Contact: Viktor Ashirov <vashirov>
Severity: medium Docs Contact: Aneta Šteflová Petrová <apetrova>
Priority: medium    
Version: 10.0CC: msauton, nhosoi, pbokoc, spichugi
Target Milestone: DS10.1   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 389-admin-1.1.44-1.el7dsrv Doc Type: Bug Fix
Doc Text:
setup-ds-admin.pl no longer fails after running remove-ds-admin.pl due to missing configuration files Previously, executing the remove-ds-admin.pl script removed files in the Administration Server's configuration directory if no backup was available for them. Consequently, if the user executed the setup-ds-admin.pl script after running remove-ds-admin.pl, setup-ds-admin.pl failed. The problem occurred in the following situations: * when remove-ds-admin.pl was executed repeatedly * when remove-ds-admin.pl was executed without executing the setup-ds-admin.pl first Instead of removing the files, remove-ds-admin.pl now overrides them from backup if a backup is available. As a result, the script no longer removes files that do not have a backup, and setup-ds-admin.pl no longer fails in this situation.
Story Points: ---
Clone Of:
: 1334480 (view as bug list) Environment:
Last Closed: 2016-11-07 15:39:36 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:    
Bug Blocks: 1334480    

Description Eugene Keck 2016-01-27 16:41:29 UTC
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.

Comment 1 Marc Sauton 2016-02-01 17:56:13 UTC
as a workaround, re-installing 389-admin will add back the missing config files when no backup exists

Comment 2 Marc Sauton 2016-02-15 17:34:46 UTC
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 4 Simon Pichugin 2016-09-08 19:13:48 UTC
Build tested:
389-admin-1.1.44-1.el7dsrv.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 6 Noriko Hosoi 2016-10-13 17:38:51 UTC
Your new relnote looks good.  Thanks, Aneta!

Comment 8 errata-xmlrpc 2016-11-07 15:39:36 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-2016-2665.html