diff options
author | Rob Crittenden <rcritten@redhat.com> | 2008-01-14 12:43:26 -0500 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2008-01-14 12:43:26 -0500 |
commit | c7f3c746ccfd74480064dbe73fbc754548c30927 (patch) | |
tree | e0e8296dd50c0f9815f930713a2b3e917cb83bdf /ipa-server/ipaserver/service.py | |
parent | 23ac773ada10867767e779823ab5f66c79b0dc04 (diff) | |
download | freeipa-c7f3c746ccfd74480064dbe73fbc754548c30927.tar.gz freeipa-c7f3c746ccfd74480064dbe73fbc754548c30927.tar.xz freeipa-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/service.py')
-rw-r--r-- | ipa-server/ipaserver/service.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ipa-server/ipaserver/service.py b/ipa-server/ipaserver/service.py index f6df6e5b3..0ea3f6618 100644 --- a/ipa-server/ipaserver/service.py +++ b/ipa-server/ipaserver/service.py @@ -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) |