summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/dsinstance.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-08-24 10:54:57 -0400
committerRob Crittenden <rcritten@redhat.com>2011-08-25 20:51:44 -0400
commita6220962541946f681dc1de400c76d80b71fa2e2 (patch)
treec2eb96c334608d141be8cbd69e208455a8cf5d97 /ipaserver/install/dsinstance.py
parentaad2aecb34b723cd322f46ea4aa7c349e9f5f465 (diff)
downloadfreeipa-a6220962541946f681dc1de400c76d80b71fa2e2.zip
freeipa-a6220962541946f681dc1de400c76d80b71fa2e2.tar.gz
freeipa-a6220962541946f681dc1de400c76d80b71fa2e2.tar.xz
Remove more 389-ds files/directories on uninstallation.
We were orphaning a few files/directories when uninstalling 389-instances both for IPA and dogtag. This should remove everything but the logs. ticket https://fedorahosted.org/freeipa/ticket/1700
Diffstat (limited to 'ipaserver/install/dsinstance.py')
-rw-r--r--ipaserver/install/dsinstance.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/ipaserver/install/dsinstance.py b/ipaserver/install/dsinstance.py
index 99b0215..2284825 100644
--- a/ipaserver/install/dsinstance.py
+++ b/ipaserver/install/dsinstance.py
@@ -90,6 +90,18 @@ def erase_ds_instance_data(serverid):
os.unlink("/var/run/slapd-%s.socket" % serverid)
except:
pass
+ try:
+ shutil.rmtree("/var/lib/dirsrv/scripts-%s" % serverid)
+ except:
+ pass
+ try:
+ os.unlink("/etc/dirsrv/ds.keytab")
+ except:
+ pass
+ try:
+ os.unlink("/etc/sysconfig/dirsrv-%s" % serverid)
+ except:
+ pass
# try:
# shutil.rmtree("/var/log/dirsrv/slapd-%s" % serverid)
# except:
@@ -659,6 +671,11 @@ class DsInstance(service.Service):
user_exists = self.restore_state("user_exists")
if user_exists == False:
+ pent = pwd.getpwnam(DS_USER)
+ try:
+ os.unlink("/var/tmp/ldap_%d" % pent.pw_uid)
+ except:
+ pass
try:
ipautil.run(["/usr/sbin/userdel", DS_USER])
except ipautil.CalledProcessError, e: