I manage a handful of servers running the various roles of a Ahsay online backup solution.A few times a year the software is updated and I need to apply patches on my servers.Annoyingly the patches are rather poorly packaged/distributed, so where one would like to have the servers installed/updated using yum everything is instead handled manually.Installing the server the first time is rather simple, unpack the archive file to /usr/local and run install.sh (to create init-scripts and such).After that however the management start to get annoying. To make setting changes and rebrand the server you make changes to startup-scripts and the actual xml-files that make up the server.This in itself would be no big issue if it wasn't for the fact that every time a new patch is released it comes with the stock versions of these files and instructions to overwrite the customized ones.Rewriting the files on every update on multiple server naturally is quite a hassle.So I find myself proofreading most of the files in the patch, handpicking the ones I figure contain the actual updates and updating only those.Now, it is not billions of files, just enough of them to be annoying. The latest patch:# find . -type f./webapps/rdr/jsp/lib/common.js./webapps/rdr/WEB-INF/lib/rdr.jar./webapps/rdr/WEB-INF/web.xml./webapps/rdr/WEB-INF/struts-config.xml./webapps/obs/WEB-INF/lib/rdr.jar./webapps/obs/WEB-INF/web.xml./webapps/obs/WEB-INF/struts-config.xml./tomcat/lib/libFileSysUtilObdX86.so./tomcat/lib/libFileSysUtilFbdX64.so./tomcat/lib/libFileSysUtilObdX64.so./tomcat/lib/mail.jar./tomcat/lib/libFileSysUtilSosSp9.so./tomcat/lib/libFileSysUtilFbdX86.so./tomcat/lib/libFileSysUtilLinX64.so./tomcat/lib/libFileSysUtilLinSpc.so./tomcat/lib/libFileSysUtilSosX86.so./tomcat/lib/libFileSysUtilLinPpc.so./tomcat/lib/libFileSysUtilLinArm.so./tomcat/lib/libFileSysUtilLinP64.so./tomcat/lib/libFileSysUtilLinX86.so./tomcat/lib/libFileSysUtilSosX64.so./tomcat/lib/libFileSysUtilSosSpc.so./tomcat/lib/ani.jar./bin/startup.sh./bin/shutdown.shDoing the following I've managed to spot the text differences more easily:for NEW in `find . | xargs file | grep text | sed 's/:.*$//' | xargs`do OLD=`echo $NEW | sed 's!^\.!/usr/local/rdr!'` echo -e $NEW \t\treplaces $OLD diff $OLD $NEWdoneAnd in this latest patch there where no update (that I could identify) to any of the text files. Meaning I could just replace the diff with rm $NEW.After that I ran a diff over all of the files instead of just the text files:# for NEW in `find . -type f | xargs`; do OLD=`echo $NEW | sed 's!^\.!/usr/local/rdr!'`; diff $NEW $OLD; doneBinary files ./webapps/rdr/WEB-INF/lib/rdr.jar and /usr/local/rdr/webapps/rdr/WEB-INF/lib/rdr.jar differBinary files ./webapps/obs/WEB-INF/lib/rdr.jar and /usr/local/rdr/webapps/obs/WEB-INF/lib/rdr.jar differBinary files ./tomcat/lib/mail.jar and /usr/local/rdr/tomcat/lib/mail.jar differBinary files ./tomcat/lib/libFileSysUtilSosX64.so and /usr/local/rdr/tomcat/lib/libFileSysUtilSosX64.so differBinary files ./tomcat/lib/ani.jar and /usr/local/rdr/tomcat/lib/ani.jar differGiving the list of the 5 (out of 25) I actually need to change.This seems like the kind of headache package maintainers deal with all the time, is there some way to make the process less cumbersome?My servers (if it make any difference) are running CentOS 6.5.
Assistance applying poorly packaged patches?
centos;software installation;upgrade;java;tomcat
Judging by your description, you don't get patches but rather updated versions of files. What you could do is to keep text files from a vanilla installation of your software in ~/sw_current with a copy in ~/sw_new. Every time you get an update, you should apply it to ~/sw_new by blindly copying the files and generate a real diff patch:diff -rupN ~/sw_current/ ~/sw_new/ > update.patchThat would produce the patch with instructions on which lines to update in which files, while keeping the rest of the files intact. This patch should then be applied to your real installations:cd /path/to/softwarepatch < update.patchNote that if you manually changed a particular text line on your system, and then that line got updated, applying the patch will produce a conflict that you will have to resolve manually.Once the update have been applied, don't forget to remove your vanilla ~/sw_current directory and copy the contents of ~/sw_new to ~/sw_current.Concerning the binary files provided with updates, you can just copy those on all your machines overwriting the originals, as I imagine you never modify binary files.