summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipaserver/webguiinstance.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2008-01-14 12:43:26 -0500
committerRob Crittenden <rcritten@redhat.com>2008-01-14 12:43:26 -0500
commitc7f3c746ccfd74480064dbe73fbc754548c30927 (patch)
treee0e8296dd50c0f9815f930713a2b3e917cb83bdf /ipa-server/ipaserver/webguiinstance.py
parent23ac773ada10867767e779823ab5f66c79b0dc04 (diff)
downloadfreeipa.git-c7f3c746ccfd74480064dbe73fbc754548c30927.tar.gz
freeipa.git-c7f3c746ccfd74480064dbe73fbc754548c30927.tar.xz
freeipa.git-c7f3c746ccfd74480064dbe73fbc754548c30927.zip
Backup system state in ipa-server-install
This patch adds a sysrestore module which allows ipa-server-install code to backup any system state so that it can be restored again with e.g. ipa-server-install --uninstall. The idea is that any files ipa-server-install modifies gets backed up to /var/cache/ipa/sysrestore/ while any "meta" state, like whether a service is enabled with chkconfig, is saved to /var/cache/ipa/sysrestore.state. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Diffstat (limited to 'ipa-server/ipaserver/webguiinstance.py')
-rw-r--r--ipa-server/ipaserver/webguiinstance.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/ipa-server/ipaserver/webguiinstance.py b/ipa-server/ipaserver/webguiinstance.py
index 28543558..f3900245 100644
--- a/ipa-server/ipaserver/webguiinstance.py
+++ b/ipa-server/ipaserver/webguiinstance.py
@@ -24,6 +24,14 @@ class WebGuiInstance(service.Service):
service.Service.__init__(self, "ipa-webgui")
def create_instance(self):
- self.step("starting ipa-webgui", self.restart)
- self.step("configuring ipa-webgui to start on boot", self.chkconfig_on)
+ self.step("starting ipa-webgui", self.__start)
+ self.step("configuring ipa-webgui to start on boot", self.__enable)
self.start_creation("Configuring ipa-webgui")
+
+ def __start(self):
+ self.backup_state("running", self.is_running())
+ self.restart()
+
+ def __enable(self):
+ self.backup_state("enabled", self.is_enabled())
+ self.chkconfig_on()