Bug 1002603

Summary: Samba hook scripts don't get updated with rpm update.
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: surabhi <sbhaloth>
Component: sambaAssignee: Bala.FA <barumuga>
Status: CLOSED ERRATA QA Contact: surabhi <sbhaloth>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 2.1CC: amarts, dpati, lmohanty, sdharane, surs, vagarwal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.4.0.30rhs-2.el6rhs Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-23 22:32:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 956495    
Bug Blocks:    

Description surabhi 2013-08-29 14:01:35 UTC
Description of problem:
After doing a rpm update the hooks scripts does not get updated with the latest changes.

Version-Release number of selected component (if applicable):
glusterfs-3.4.0.24rhs-1.el6rhs.x86_64.rpm

How reproducible:
Always.

Steps to Reproduce:
1.Update the existing rpm's to new one.
2.Create a volume.
3.Start a volume.
4.check the hooks script:
/var/lib/glusterd/hooks/1/start/post/S30samba-start.sh
/var/lib/glusterd/hooks/1/stop/pre/S30samba-stop.sh

Actual results:
hooks scripts don't get updated and no new scripts have been saved on the above location.

Expected results:
Either the existing hooks scripts should get updated or there should be a new script saved in the location above to make use of it.

Additional info:
We may add something to spec file to keep a copy of new hook script or move the old one to .old file.

Comment 2 surabhi 2013-08-29 14:07:15 UTC
After discussion with Amar assigning it to Bala as it need change in glusterfs spec file.

Comment 3 Amar Tumballi 2013-08-29 17:31:19 UTC
Is the below patch enough?

----
amar@supernova:~/work/rhs-glusterfs$ git diff
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index 4d6ea71..867b6f5 100644
--- a/glusterfs.spec.in
+++ b/glusterfs.spec.in
@@ -972,6 +972,17 @@ if [ -d /var/lib/glusterd/vols ]; then
     done
 fi
 
+# Rename old hookscripts in an RPM-standard way.  These aren't actually
+# considered package config files, so %config doesn't work for them.
+if [ -d /var/lib/glusterd/hooks ]; then
+    for file in $(find /var/lib/glusterd/hooks -type f); do
+        newfile=${file}.rpmsave
+        echo "warning: ${file} saved as ${newfile}"
+        mv ${file} ${newfile}
+    done
+fi
+
+
 # Need to copy the file.
 mkdir -p /var/lib/glusterd/groups
 if [ ! -r /var/lib/glusterd/groups/virt ]; then

Comment 4 Amar Tumballi 2013-08-30 06:30:58 UTC
https://code.engineering.redhat.com/gerrit/#/c/12211

Comment 5 surabhi 2013-09-04 13:55:58 UTC
Verified on latest version:
glusterfs-3.4.0.30rhs-2.el6rhs.x86_64

The samba hooks scripts are getting updated.

Comment 6 Scott Haines 2013-09-23 22:32:17 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. 

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1262.html