Xymon Mailing List Archive search

make install overwrites xymon-apache.conf (and creates unnecessary bak files)

3 messages in this thread

list Sebastian Auriol · Wed, 7 Dec 2011 11:59:37 -0000 ·
On the latest trunk, a make install overwrites xymon-apache.conf without
either merging in my additions to it, or making a backup of the existing
file.  This resulted in me losing the additions that I made to it on Monday.
Rather annoying.  This appears to be the line in the make install output
that is so offensive :p
 
cd etcfiles; cp -fp xymon-apache.conf
/usr/local/hobbit/server/etc/xymon-apache.conf
 
It seems some other configuration files have this kind of thing:
 
cd etcfiles; ../../build/merge-sects graphs.cfg
/usr/local/hobbit/server/etc/graphs.cfg
cd etcfiles; ../../build/merge-lines columndoc.csv
/usr/local/hobbit/server/etc/columndoc.csv

...which presumably does some merging.  Can we get this on xymon-apache too?
 
I was actually going to submit my changes to xymon-apache.conf for possible
inclusion in the trunk source - so I'll redo my changes now...
 
This changes may not be wanted by everyone, but at least for me, it's part
of the migration from hobbit to xymon...  so here is my diff:
 
[etcfiles]# diff -u xymon-apache.conf.orig xymon-apache.conf
--- xymon-apache.conf.orig      2011-12-07 11:17:27.000000000 +0000
+++ xymon-apache.conf   2011-12-07 11:37:17.000000000 +0000
@@ -12,6 +12,7 @@
 #          DocumentRoot /usr/local/hobbit/server/www
 
 Alias /hobbit/  "/usr/local/hobbit/server/www/"
+Alias /xymon/  "/usr/local/hobbit/server/www/"
 <Directory "/usr/local/hobbit/server/www">
     Options Indexes FollowSymLinks Includes MultiViews
     Order allow,deny
@@ -19,6 +20,7 @@
 </Directory>
 
 ScriptAlias /hobbit-cgi/ "/var/www/hobbit-cgi//"
+ScriptAlias /xymon-cgi/ "/var/www/hobbit-cgi//"
 <Directory "/var/www/hobbit-cgi/">
     AllowOverride None
     Options ExecCGI Includes
@@ -27,6 +29,7 @@
 </Directory>
 
 ScriptAlias /hobbit-seccgi/ "/var/www/hobbit-seccgi//"
+ScriptAlias /xymon-seccgi/ "/var/www/hobbit-seccgi//"
 <Directory "/var/www/hobbit-seccgi/">
     AllowOverride None
     Options ExecCGI Includes
@@ -93,3 +96,38 @@
 RewriteRule ^/hobbit-seccgi/hobbit-ackinfo.sh /hobbit-seccgi/ackinfo.sh
[R=permanent,L]
 RewriteRule ^/hobbit-seccgi/hobbit-useradm.sh /hobbit-seccgi/useradm.sh
[R=permanent,L]
 
• +RewriteRule ^/xymon/bb.html /xymon/xymon.html [R=permanent,L]
+RewriteRule ^/xymon/bb2.html /xymon/nongreen.html [R=permanent,L]
+RewriteRule ^/xymon/bbnk.html /xymon/critical.html [R=permanent,L]
• +RewriteRule ^/xymon-cgi/bb-hist.sh /xymon-cgi/history.sh [R=permanent,L]
+RewriteRule ^/xymon-cgi/bb-eventlog.sh /xymon-cgi/eventlog.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/bb-rep.sh /xymon-cgi/report.sh [R=permanent,L]
+RewriteRule ^/xymon-cgi/bb-replog.sh /xymon-cgi/reportlog.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/bb-snapshot.sh /xymon-cgi/snapshot.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/bb-findhost.sh /xymon-cgi/findhost.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/bb-csvinfo.sh /xymon-cgi/csvinfo.sh [R=permanent,L]
+RewriteRule ^/xymon-cgi/hobbitcolumn.sh /xymon-cgi/columndoc.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/bb-datepage.sh /xymon-cgi/datepage.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/hobbitgraph.sh /xymon-cgi/showgraph.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/bb-hostsvc.sh /xymon-cgi/svcstatus.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/bb-histlog.sh /xymon-cgi/historylog.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/hobbit-confreport.sh /xymon-cgi/confreport.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/hobbit-confreport-critical.sh
/xymon-cgi/confreport-critical.sh [R=permanent,L]
+RewriteRule ^/xymon-cgi/hobbit-nkview.sh /xymon-cgi/criticalview.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/hobbit-certreport.sh /xymon-cgi/certreport.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/hobbit-nongreen.sh /xymon-cgi/nongreen.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/hobbit-hostgraphs.sh /xymon-cgi/hostgraphs.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/hobbit-ghosts.sh /xymon-cgi/ghostlist.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/hobbit-notifylog.sh /xymon-cgi/notifications.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/hobbit-hostlist.sh /xymon-cgi/hostlist.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/hobbit-perfdata.sh /xymon-cgi/perfdata.sh
[R=permanent,L]
+RewriteRule ^/xymon-cgi/hobbit-topchanges.sh /xymon-cgi/topchanges.sh
[R=permanent,L]
• +RewriteRule ^/xymon-seccgi/bb-ack.sh /xymon-seccgi/acknowledge.sh
[R=permanent,L]
+RewriteRule ^/xymon-seccgi/hobbit-enadis.sh /xymon-seccgi/enadis.sh
[R=permanent,L]
+RewriteRule ^/xymon-seccgi/hobbit-nkedit.sh /xymon-seccgi/criticaleditor.sh
[R=permanent,L]
+RewriteRule ^/xymon-seccgi/hobbit-ackinfo.sh /xymon-seccgi/ackinfo.sh
[R=permanent,L]
+RewriteRule ^/xymon-seccgi/hobbit-useradm.sh /xymon-seccgi/useradm.sh
[R=permanent,L]
• [etcfiles]#

Turns out this file is actually not in the source, it seems, but is created
during the build process.  So the source diff would look a bit different!
 
As a small aside, another untidyness is that the make install process seems
to be creating backup copies of files that have NOT changed since the last
install:
 
[etc]# ls -l | grep "Dec  7"
-rw-r--r--  1 hobbit hobbit     3374 Dec  7 11:21 cgioptions.cfg
-rw-r--r--  1 hobbit hobbit     3374 Dec  7 11:21 cgioptions.cfg.bak
-rw-r--r--  1 hobbit hobbit     4193 Dec  7 11:21 client-local.cfg
-rw-r--r--  1 hobbit hobbit     4193 Dec  7 11:21 client-local.cfg.bak
-rw-r--r--  1 hobbit hobbit    11524 Dec  7 11:21 columndoc.csv
-rw-r--r--  1 hobbit hobbit    11524 Dec  7 11:21 columndoc.csv.bak
-rw-r--r--  1 hobbit hobbit        0 Dec  7 11:22 cookies.session
-rw-rw-r--  1 hobbit apache        0 Dec  7 11:21 critical.cfg
-rw-rw-r--  1 hobbit apache        0 Dec  7 11:21 critical.cfg.bak
-rw-r--r--  1 hobbit hobbit    74994 Dec  7 11:21 graphs.cfg
-rw-r--r--  1 hobbit hobbit    74994 Dec  7 11:21 graphs.cfg.bak
-rw-r--r--  1 hobbit hobbit     4674 Dec  7 11:21 protocols.cfg
-rw-r--r--  1 hobbit hobbit     4674 Dec  7 11:21 protocols.cfg.bak
-rw-r--r--  1 hobbit hobbit    11118 Dec  7 11:21 tasks.cfg
-rw-r--r--  1 hobbit hobbit    11118 Dec  7 11:21 tasks.cfg.bak
-rw-r--r--  1 hobbit hobbit     4615 Dec  7 11:17 xymon-apache.conf
-rw-r--r--  1 hobbit hobbit    12784 Dec  7 11:21 xymonserver.cfg
-rw-r--r--  1 hobbit hobbit    12784 Dec  7 11:21 xymonserver.cfg.bak

I believe all of these bak files are the same as the originals.  Presumably
the previous bak files were lost during this process, which is potentially
rather annoying too!

Kind regards, 

SebA
list Henrik Størner · Tue, 13 Dec 2011 12:27:43 +0100 ·
quoted from Sebastian Auriol
On 07-12-2011 12:59, SebA wrote:
On the latest trunk, a make install overwrites xymon-apache.conf without
either merging in my additions to it, or making a backup of the existing
file. This resulted in me losing the additions that I made to it on
Monday. Rather annoying.
Indeed. I've changed the installation so it will not overwrite an 
existing file.
quoted from Sebastian Auriol
As a small aside, another untidyness is that the make install process
seems to be creating backup copies of files that have NOT changed since
the last install:
[etc]# ls -l | grep "Dec 7"
-rw-r--r-- 1 hobbit hobbit 3374 Dec 7 11:21 cgioptions.cfg
-rw-r--r-- 1 hobbit hobbit 3374 Dec 7 11:21 cgioptions.cfg.bak
-rw-r--r-- 1 hobbit hobbit 4193 Dec 7 11:21 client-local.cfg
-rw-r--r-- 1 hobbit hobbit 4193 Dec 7 11:21 client-local.cfg.bak
-rw-r--r-- 1 hobbit hobbit 11524 Dec 7 11:21 columndoc.csv
-rw-r--r-- 1 hobbit hobbit 11524 Dec 7 11:21 columndoc.csv.bak
-rw-r--r-- 1 hobbit hobbit 0 Dec 7 11:22 cookies.session
-rw-rw-r-- 1 hobbit apache 0 Dec 7 11:21 critical.cfg
-rw-rw-r-- 1 hobbit apache 0 Dec 7 11:21 critical.cfg.bak
-rw-r--r-- 1 hobbit hobbit 74994 Dec 7 11:21 graphs.cfg
-rw-r--r-- 1 hobbit hobbit 74994 Dec 7 11:21 graphs.cfg.bak
-rw-r--r-- 1 hobbit hobbit 4674 Dec 7 11:21 protocols.cfg
-rw-r--r-- 1 hobbit hobbit 4674 Dec 7 11:21 protocols.cfg.bak
-rw-r--r-- 1 hobbit hobbit 11118 Dec 7 11:21 tasks.cfg
-rw-r--r-- 1 hobbit hobbit 11118 Dec 7 11:21 tasks.cfg.bak
-rw-r--r-- 1 hobbit hobbit 4615 Dec 7 11:17 xymon-apache.conf
-rw-r--r-- 1 hobbit hobbit 12784 Dec 7 11:21 xymonserver.cfg
-rw-r--r-- 1 hobbit hobbit 12784 Dec 7 11:21 xymonserver.cfg.bak

I believe all of these bak files are the same as the originals.
Probably, if you didn't change the Xymon build configuration.
quoted from Sebastian Auriol
Presumably the previous bak files were lost during this process, which
is potentially rather annoying too!
Saving a backup file has to be your own responsibility. The Xymon 
installer should take care to save the current config-files before 
writing new ones, and that it what it does - it doesn't do version 
control of your setup.


Regards,
Henrik
list Sebastian Auriol · Tue, 13 Dec 2011 12:00:42 -0000 ·
quoted from Henrik Størner
xymon-bounces at xymon.com wrote:
On 07-12-2011 12:59, SebA wrote:
On the latest trunk, a make install overwrites xymon-apache.conf
without either merging in my additions to it, or making a backup of
the existing file. This resulted in me losing the additions that I
made to it on Monday. Rather annoying.
Indeed. I've changed the installation so it will not overwrite an
existing file. 
Great!  Thanks for all your work!
quoted from Henrik Størner
As a small aside, another untidyness is that the make install process
seems to be creating backup copies of files that have NOT changed
since the last install: [etc]# ls -l | grep "Dec 7"
-rw-r--r-- 1 hobbit hobbit 3374 Dec 7 11:21 cgioptions.cfg
-rw-r--r-- 1 hobbit hobbit 3374 Dec 7 11:21 cgioptions.cfg.bak
-rw-r--r-- 1 hobbit hobbit 4193 Dec 7 11:21 client-local.cfg
-rw-r--r-- 1 hobbit hobbit 4193 Dec 7 11:21 client-local.cfg.bak
-rw-r--r-- 1 hobbit hobbit 11524 Dec 7 11:21 columndoc.csv
-rw-r--r-- 1 hobbit hobbit 11524 Dec 7 11:21 columndoc.csv.bak
-rw-r--r-- 1 hobbit hobbit 0 Dec 7 11:22 cookies.session
-rw-rw-r-- 1 hobbit apache 0 Dec 7 11:21 critical.cfg
-rw-rw-r-- 1 hobbit apache 0 Dec 7 11:21 critical.cfg.bak
-rw-r--r-- 1 hobbit hobbit 74994 Dec 7 11:21 graphs.cfg
-rw-r--r-- 1 hobbit hobbit 74994 Dec 7 11:21 graphs.cfg.bak
-rw-r--r-- 1 hobbit hobbit 4674 Dec 7 11:21 protocols.cfg
-rw-r--r-- 1 hobbit hobbit 4674 Dec 7 11:21 protocols.cfg.bak
-rw-r--r-- 1 hobbit hobbit 11118 Dec 7 11:21 tasks.cfg
-rw-r--r-- 1 hobbit hobbit 11118 Dec 7 11:21 tasks.cfg.bak
-rw-r--r-- 1 hobbit hobbit 4615 Dec 7 11:17 xymon-apache.conf
-rw-r--r-- 1 hobbit hobbit 12784 Dec 7 11:21 xymonserver.cfg
-rw-r--r-- 1 hobbit hobbit 12784 Dec 7 11:21 xymonserver.cfg.bak

I believe all of these bak files are the same as the originals.
Probably, if you didn't change the Xymon build configuration.
Presumably the previous bak files were lost during this process,
which is potentially rather annoying too!
Saving a backup file has to be your own responsibility. The Xymon
installer should take care to save the current config-files before
writing new ones, and that it what it does - it doesn't do version
control of your setup. 
Of course.  I'll just have to remember not to save my bakup files as .bak!
;) But actually my point was that if one does several make installs in a
very short space of time, either because one is following trunk and there
are some fixes, or because of some other changes one is making, the old
files from a month or so back will be lost. It is very unlikely that one has
made changes to config files in the space of e.g. 2 days since the last make
install. If one is updating an rpm, it will usually check to see if you made
any changes to the config files, and then prompt you to overwrite, preserve
your copy, see the changes as a diff, or go into edit mode on the new file
(IIRC). If you preserve your copy, it will put the new version as
myconfig.dist. If you overwrite, it will put the old version as .old, I
think, or maybe .bak. I presume there is some function rpms can invoke to do
this? Ref: http://www.rpm.org/max-rpm/ch-rpm-upgrade.html Most of the files
I've listed above, I haven't changed from the 'dist' version.  I was just
hoping update pain could be eliminated. (I know it is better than it used to
be.) I'm not necessarily suggesting re-implementing the rpm upgrade system,
but an md5 check on a file to see if it has changed before creating a backup
copy would at least leave the etc folder tidier and mean one wouldn't need
to check for changes made to *all* files by the make install. (I've checked
the md5's on some of the above files, and they are the same.)
Regards,
Henrik

Kind regards,

SebA