Bug 1348903

Summary: slapd.InstScriptsEnabled=false does not check for the existing instance script directory.
Product: Red Hat Enterprise Linux 7 Reporter: Amita Sharma <amsharma>
Component: 389-ds-baseAssignee: wibrown <wibrown>
Status: CLOSED NOTABUG QA Contact: Viktor Ashirov <vashirov>
Severity: low Docs Contact:
Priority: low    
Version: 7.3CC: nkinder, rmeggins, wibrown
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-05 02:38:41 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:

Description Amita Sharma 2016-06-22 09:36:56 UTC
Description of problem:
slapd.InstScriptsEnabled=false does not check for the existing instance script directory.

Version-Release number of selected component (if applicable):
389-ds-base-1.3.5.6-1.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Do setup-ds.pl and create an instance named -> slapd-instance
2. Go to /usr/lib64/dirsrv/slapd-instance
3. execute remove-ds.pl -a -f -i slapd-instance
[root@mgmt7 slapd-instance]# remove-ds.pl -a -f -i slapd-instance
cannot remove path when cwd is /usr/lib64/dirsrv/slapd-instance for /usr/lib64/dirsrv/slapd-instance:  at /usr/lib64/dirsrv/perl/DSCreate.pm line 1426.
The following errors occurred during removal:
Error: could not remove path '/usr/lib64/dirsrv/slapd-instance'.  Error: No such file or directory

NOTE:: Script directory is not removed because of the above error(human error) /usr/lib64/dirsrv/slapd-instance.

4. Now, Reinstall the directory with same ID and with slapd.InstScriptsEnabled=false ::
setup-ds.pl slapd.InstScriptsEnabled=false

Instance script directory still exists. which is misleading.


Actual results:
Instance script directory exists even if slapd.InstScriptsEnabled=false is given.

Expected results:
It should complain about the existing instance script directory which is there already due to human error/previous removal error.

Additional info:
It is a corner case, but leads to inconsistent behavior.