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/ipa-install/ipa-server-install | |
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/ipa-install/ipa-server-install')
-rw-r--r-- | ipa-server/ipa-install/ipa-server-install | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ipa-server/ipa-install/ipa-server-install b/ipa-server/ipa-install/ipa-server-install index 5f0879d73..bc4d8e27a 100644 --- a/ipa-server/ipa-install/ipa-server-install +++ b/ipa-server/ipa-install/ipa-server-install @@ -49,6 +49,7 @@ import ipaserver.ntpinstance import ipaserver.webguiinstance from ipaserver import service +from ipaserver import sysrestore from ipaserver.installutils import * from ipa.ipautil import * @@ -167,6 +168,7 @@ def read_ip_address(host_name): continue print "Adding ["+ip+" "+host_name+"] to your /etc/hosts file" + sysrestore.backup_file("/etc/hosts") hosts_fd = open('/etc/hosts', 'r+') hosts_fd.seek(0, 2) hosts_fd.write(ip+'\t'+host_name+' '+host_name[:host_name.find('.')]+'\n') @@ -420,6 +422,7 @@ def main(): ds.change_admin_password(admin_password) # Create the config file + sysrestore.backup_file("/etc/ipa/ipa.conf") fd = open("/etc/ipa/ipa.conf", "w") fd.write("[defaults]\n") fd.write("server=" + host_name + "\n") |