summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipaserver/krbinstance.py
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2008-01-11 11:57:36 +0000
committerMark McLoughlin <markmc@redhat.com>2008-01-11 11:57:36 +0000
commit4a162f6fc8d53d959dd23e1138059dd239ff5124 (patch)
tree650d2c3394b728aa694e6da9ea8ded29427ab99c /ipa-server/ipaserver/krbinstance.py
parentc7f3c746ccfd74480064dbe73fbc754548c30927 (diff)
downloadfreeipa.git-4a162f6fc8d53d959dd23e1138059dd239ff5124.tar.gz
freeipa.git-4a162f6fc8d53d959dd23e1138059dd239ff5124.tar.xz
freeipa.git-4a162f6fc8d53d959dd23e1138059dd239ff5124.zip
Add ipa-server-install --uninstall
Add a --uninstall option to ipa-server-install which tries to restore the system to the way it was before ipa-server-install was run using the state backed up through sysrestore.py. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Diffstat (limited to 'ipa-server/ipaserver/krbinstance.py')
-rw-r--r--ipa-server/ipaserver/krbinstance.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/ipa-server/ipaserver/krbinstance.py b/ipa-server/ipaserver/krbinstance.py
index 10dab364..28233f24 100644
--- a/ipa-server/ipaserver/krbinstance.py
+++ b/ipa-server/ipaserver/krbinstance.py
@@ -379,4 +379,37 @@ class KrbInstance(service.Service):
pent = pwd.getpwnam(self.ds_user)
os.chown("/var/kerberos/krb5kdc/kpasswd.keytab", pent.pw_uid, pent.pw_gid)
+ def uninstall(self):
+ running = self.restore_state("running")
+ enabled = self.restore_state("enabled")
+ kpasswd_running = sysrestore.restore_state("ipa-kpasswd", "running")
+ kpasswd_enabled = sysrestore.restore_state("ipa-kpasswd", "enabled")
+
+ if not running is None:
+ self.stop()
+ if not kpasswd_running is None:
+ service.stop("ipa-kpasswd")
+
+ if not enabled is None and not enabled:
+ self.chkconfig_off()
+ if not kpasswd_enabled is None and not kpasswd_enabled:
+ service.chkconfig_off("ipa-kpasswd")
+
+ for f in ["/var/kerberos/krb5kdc/ldappwd",
+ "/var/kerberos/krb5kdc/kdc.conf",
+ "/etc/krb5.conf",
+ "/usr/share/ipa/html/krb5.ini",
+ "/usr/share/ipa/html/krb.con",
+ "/usr/share/ipa/html/krbrealm.con",
+ "/etc/dirsrv/ds.keytab",
+ "/etc/sysconfig/dirsrv",
+ "/etc/krb5.keytab",
+ "/var/kerberos/krb5kdc/kpasswd.keytab",
+ "/etc/sysconfig/ipa-kpasswd"]:
+ sysrestore.restore_file(f)
+
+ if not running is None and running:
+ self.start()
+ if not kpasswd_running is None and kpasswd_running:
+ service.start("ipa-kpasswd")