Support #2585

icinga.spec: copy old retention.dat and objects.pre.cache to new location, if found

Added by dnsmichi almost 2 years ago. Updated almost 2 years ago.

Status:ResolvedStart date:05/07/2012
Priority:NormalDue date:
Assignee:dnsmichi% Done:

100%

Category:Packaging
Target version:Icinga 1.x - 1.7

Description

as there's the move away from /var/icinga to /var/spool/icinga we need to make sure that the old retained data is being copied on upgrade. logs did not change, and the rest is not historical.

Associated revisions

Revision 132c2cbf
Added by dnsmichi almost 2 years ago

copy old retention.dat and objects.pre.cache to new location, if found #2585

refs #2585

Revision cbed4461
Added by dnsmichi almost 2 years ago

copy old retention.dat and objects.pre.cache to new location, if found #2585

refs #2585

History

#1 Updated by dnsmichi almost 2 years ago

  • Subject changed from icinga.spec: copy old retention.dat to new location to icinga.spec: copy old retention.dat and objects.pre.cache to new location, if found

#2 Updated by dnsmichi almost 2 years ago

put an old one into this location, and edit the version to 1.6.0 or whatever.

vim /var/icinga/retention.dat

then rebuild the packages, force an upgrade.

~/packages/x86_64 $ sudo rpm -Uhv --force icinga-1.7.0-1.el5.x86_64.rpm icinga-gui-1.7.0-1.el5.x86_64.rpm icinga-idoutils-libdbi-mysql-1.7.0-1.el5.x86_64.rpm
$ ls -ltr /var/icinga/
insgesamt 0
$ ls -ltr /var/spool/icinga/
insgesamt 56
srwxr-xr-x 1 icinga icinga        0  6. Mai 14:25 ido.sock
-rw-r--r-- 1 icinga icinga    14862  7. Mai 16:31 retention.dat
-rw-r--r-- 1 icinga icinga    14205  7. Mai 16:31 objects.cache
-rw-rw-r-- 1 icinga icinga        0  7. Mai 16:31 idomod.tmp
drwxr-sr-x 2 icinga icingacmd  4096  7. Mai 16:31 cmd
drwxrwxr-x 2 icinga icinga     4096  7. Mai 16:31 checkresults
-rw-r--r-- 1 icinga icinga    15463  7. Mai 16:31 status.dat
$ vim /var/spool/icinga/retention.dat

########################################
#      ICINGA STATE RETENTION FILE
#
# THIS FILE IS AUTOMATICALLY GENERATED
# BY ICINGA.  DO NOT MODIFY THIS FILE!
########################################
info {
created=1336397117
version=1.6.0
}

so icinga has successfully read the file, but not yet modified it to its new version - that will happen on future restarts, or daily retention.

the upgrade routine is only triggered once, then the files are deleted from the old location.

#3 Updated by dnsmichi almost 2 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

works for me, and my rpms. so the change is clean and upgradable, even from repoforge.

Also available in: Atom PDF