summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-06-08 08:31:37 +0200
committerRob Crittenden <rcritten@redhat.com>2012-06-10 21:23:10 -0400
commitc856fb60737612781fab30760bceeb8bbf6312d9 (patch)
treebea9c1f3240e876ac28eeb5db3eea2c5b9a036b3 /install
parent4507dcda58bbe663597c43672f91af7225e2a9b4 (diff)
downloadfreeipa-c856fb60737612781fab30760bceeb8bbf6312d9.tar.gz
freeipa-c856fb60737612781fab30760bceeb8bbf6312d9.tar.xz
freeipa-c856fb60737612781fab30760bceeb8bbf6312d9.zip
Add sysupgrade state file
When IPA package is being updated, some of the configuration files are also updated. Sometimes it may be useful to store upgrade meta information for next package upgrades. For example an information that some config file was already updated and we don't want to update it again if user purposedly reverted the change. This patch adds a new StateFile in /var/lib/ipa/sysupgrade which is capable of holding this information. New sysupgrade.py module was created to provide simple API to access the upgrade state information.
Diffstat (limited to 'install')
-rw-r--r--install/Makefile.am3
-rwxr-xr-xinstall/tools/ipa-server-install4
2 files changed, 7 insertions, 0 deletions
diff --git a/install/Makefile.am b/install/Makefile.am
index 4d24d072d..5670f9bd9 100644
--- a/install/Makefile.am
+++ b/install/Makefile.am
@@ -19,11 +19,14 @@ SUBDIRS = \
install-exec-local:
mkdir -p $(DESTDIR)$(localstatedir)/lib/ipa/sysrestore
chmod 700 $(DESTDIR)$(localstatedir)/lib/ipa/sysrestore
+ mkdir -p $(DESTDIR)$(localstatedir)/lib/ipa/sysupgrade
+ chmod 700 $(DESTDIR)$(localstatedir)/lib/ipa/sysupgrade
mkdir -p $(DESTDIR)$(localstatedir)/cache/ipa/sessions
chmod 700 $(DESTDIR)$(localstatedir)/cache/ipa/sessions
uninstall-local:
-rmdir $(DESTDIR)$(localstatedir)/lib/ipa/sysrestore
+ -rmdir $(DESTDIR)$(localstatedir)/lib/ipa/sysupgrade
-rmdir $(DESTDIR)$(localstatedir)/lib/ipa
-rmdir $(DESTDIR)$(localstatedir)/cache/ipa/sessions
-rmdir $(DESTDIR)$(localstatedir)/cache/ipa
diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install
index 871bfd52a..61c2b9d8c 100755
--- a/install/tools/ipa-server-install
+++ b/install/tools/ipa-server-install
@@ -48,6 +48,7 @@ from ipaserver.install import ntpinstance
from ipaserver.install import certs
from ipaserver.install import cainstance
from ipaserver.install import memcacheinstance
+from ipaserver.install import sysupgrade
from ipaserver.install import service, installutils
from ipapython import version
@@ -495,6 +496,9 @@ def uninstall():
except CalledProcessError, e:
print >>sys.stderr, "Failed to set this machine hostname back to %s (%s)." % (old_hostname, str(e))
+ # remove upgrade state file
+ sysupgrade.remove_upgrade_file()
+
if fstore.has_files():
root_logger.error('Some files have not been restored, see /var/lib/ipa/sysrestore/sysrestore.index')
has_state = False