ldap/admin/src/scripts/DSCreate.pm.in | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
New commits:
commit afd7699f13b07bd1624432f16b56044840b50031
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Jun 9 17:10:20 2015 -0400
Ticket 47913 - remove-ds.pl should not remove /var/lib/dirsrv
Bug Description: When removing the last instance, the remove-ds.pl
script is incorrectly removing the /var/lib/dirsrv
directory.
Fix Description: Only /var/lock/dirsrv & /var/run/dirsrv have their
ownership changed during an install, so only these
directories need to be removed. Also, changed this
cleanup code to be run only if there are no errors.
https://fedorahosted.org/389/ticket/47913
Reviewed by: nhosoi(Thanks!)
diff --git a/ldap/admin/src/scripts/DSCreate.pm.in
b/ldap/admin/src/scripts/DSCreate.pm.in
index ae8d1e3..158a038 100644
--- a/ldap/admin/src/scripts/DSCreate.pm.in
+++ b/ldap/admin/src/scripts/DSCreate.pm.in
@@ -1482,17 +1482,15 @@ sub removeDSInstance {
# update systemd files
push @errs, updateSystemD();
- # remove /var/lock/dirsrv & /var/run/dirsrv if this was the last instance
- if(!<$pkglockdir/*>){
- rmdir $pkglockdir;
- rmdir $pkgrundir;
- rmdir $pkglibdir;
- }
-
# if we got here, report success
if (@errs) {
debug(1, "Could not successfully remove $instname\n");
} else {
+ if (!<$pkglockdir/*>){
+ # If this was the last instance, remove /var/lock/dirsrv &
/var/run/dirsrv
+ rmdir $pkglockdir;
+ rmdir $pkgrundir;
+ }
debug(1, "Instance $instname removed.\n");
}