Browse Source

Make removeds.pl remove instance initconfig script

When removing an instance, we need to be sure to remove the
instance specific initconfig script.
Nathan Kinder 16 years ago
parent
commit
b6263499b3
1 changed files with 10 additions and 0 deletions
  1. 10 0
      ldap/admin/src/scripts/DSCreate.pm.in

+ 10 - 0
ldap/admin/src/scripts/DSCreate.pm.in

@@ -1109,6 +1109,16 @@ sub removeDSInstance {
     # Finally, config dir
     push @errs, remove_tree($entry, "nsslapd-schemadir", $instname, 1, "\.db\$");
 
+    # Remove the instance specific initconfig script
+    if ( -f "@initconfigdir@/@package_name@-$inst" ) {
+        my $rc = unlink("@initconfigdir@/@package_name@-$inst");
+        if ( 0 == $rc )
+        {
+            push @errs, [ 'error_removing_path', "@initconfigdir@/@package_name@-$inst", $! ];
+            debug(1, "Warning: @initconfigdir@/@package_name@-$inst was not removed. Error: $!\n");
+        }
+    }
+
     # remove the selinux label from the ports if needed
     if ("@with_selinux@") {
         foreach my $port (@{$entry->{"nsslapd-port"}})