summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/service.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-05-03 15:21:51 -0400
committerJason Gerard DeRose <jderose@redhat.com>2010-05-03 13:41:18 -0600
commit04e9056ec2b6e0360f3f3545fd638ecc17aaad2c (patch)
treeb9fefef29f7ba68c1932aac39f7b2bedfc85d356 /ipaserver/install/service.py
parent6d35812252cb4fcf34cf13bf88cbb705560afc3a (diff)
downloadfreeipa-04e9056ec2b6e0360f3f3545fd638ecc17aaad2c.tar.gz
freeipa-04e9056ec2b6e0360f3f3545fd638ecc17aaad2c.tar.xz
freeipa-04e9056ec2b6e0360f3f3545fd638ecc17aaad2c.zip
Make the installer/uninstaller more aware of its state
We have had a state file for quite some time that is used to return the system to its pre-install state. We can use that to determine what has been configured. This patch: - uses the state file to determine if dogtag was installed - prevents someone from trying to re-install an installed server - displays some output when uninstalling - re-arranges the ipa_kpasswd installation so the state is properly saved - removes pkiuser if it was added by the installer - fetches and installs the CA on both masters and clients
Diffstat (limited to 'ipaserver/install/service.py')
-rw-r--r--ipaserver/install/service.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ipaserver/install/service.py b/ipaserver/install/service.py
index d9db9ba45..4958721e7 100644
--- a/ipaserver/install/service.py
+++ b/ipaserver/install/service.py
@@ -186,6 +186,9 @@ class Service:
logging.critical("Could not add certificate to service %s entry: %s" % (self.principal, str(e)))
conn.unbind()
+ def is_configured(self):
+ return self.sstore.has_state(self.service_name)
+
def set_output(self, fd):
self.output_fd = fd
@@ -257,6 +260,9 @@ class SimpleServiceInstance(Service):
self.chkconfig_on()
def uninstall(self):
+ if self.is_configured():
+ self.print_msg("Unconfiguring %s" % self.service_name)
+
running = self.restore_state("running")
enabled = not self.restore_state("enabled")