summaryrefslogtreecommitdiffstats
path: root/glusterfs.spec.in
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2011-12-14 13:37:36 -0500
committerVijay Bellur <vijay@gluster.com>2012-01-27 04:09:51 -0800
commitc13e3e090cc4d97dbf87a21b9de77e0b37ee5dd9 (patch)
tree279ace955800aede07bf049328d47b7b0f5e4198 /glusterfs.spec.in
parent6b0cd9fc8450029449f7c320a2e5d766e87ac8d4 (diff)
Make volfile-save scriptlet follow .rpmsave convention.
Change-Id: I7a106defcc441679cf7c48f78eea2c04feb2853e BUG: 764702 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.com/788 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'glusterfs.spec.in')
-rw-r--r--glusterfs.spec.in19
1 files changed, 14 insertions, 5 deletions
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index 7cb5fb44d1b..c55da7f2d9e 100644
--- a/glusterfs.spec.in
+++ b/glusterfs.spec.in
@@ -175,11 +175,20 @@ echo "%{_prefix}/lib" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/glusterfs.conf
/sbin/ldconfig
if [ -d /etc/glusterd/vols ]; then
-#for each dir under vols, backup non-fuse .vol files as .Vol.old
-for file in `find /etc/glusterd/vols -type f ! -name *-fuse.vol `;
-do
-grep ".vol" $file &> /dev/null && fname=`basename $file .vol` && dname=`dirname $file` && cp $file $dname/$fname.Vol.old
-done
+ # Rename old volfiles in an RPM-standard way. These aren't actually
+ # considered package config files, so %config doesn't work for them.
+ #
+ # NB: we used to exempt client-side volfiles from this treatment. The
+ # only reason we do it at all (I'm guessing) is because they might be
+ # rewritten differently by a new version of code, and the old versions might
+ # be useful for a merge or rollback (especially if they were tweaked).
+ # Since that rationale does apply to client-side volfiles as well, the
+ # exception has been removed.
+ for file in $(find /etc/glusterd/vols -name '*.vol'); do
+ newfile=${file}.rpmsave
+ echo "warning: ${file} saved as ${newfile}"
+ cp ${file} ${newfile}
+ done
fi
pidof -c -o %PPID -x glusterd &> /dev/null