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>
This commit is contained in:
Rob Crittenden
2008-01-14 12:43:26 -05:00
parent 23ac773ada
commit c7f3c746cc
15 changed files with 375 additions and 20 deletions

View File

@@ -18,6 +18,7 @@
#
import logging, sys
import sysrestore
from ipa import ipautil
@@ -100,6 +101,9 @@ class Service:
def is_enabled(self):
return is_enabled(self.service_name)
def backup_state(self, key, value):
sysrestore.backup_state(self.service_name, key, value)
def print_msg(self, message):
print_msg(message, self.output_fd)