Bug 806996

Summary: [FEAT] Provide pre/post glusterd operation hooks for certain commands
Product: [Community] GlusterFS Reporter: krishnan parthasarathi <kparthas>
Component: glusterdAssignee: krishnan parthasarathi <kparthas>
Status: CLOSED CURRENTRELEASE QA Contact: amainkar
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: amarts, gluster-bugs, nsathyan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.4.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-24 13:17:47 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: 3.3.0.qa45 Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 817967    

Description krishnan parthasarathi 2012-03-26 13:51:19 EDT
Description of problem:
Currently glusterd doesn't have a mechanism by which users can perform 'administrative tasks' before and after the successful completion of a gluster command.
The interface planned would be similar to init scripts, where there would be a collection of scripts present under a 'special' directory that would be executed on an 'event'.

Directories to hold the scripts mentioned above would be created for each gluster command under glusterd's 'working dir' as follows:
(eg.)
<glusterd-working-dir>/create/pre

<glusterd-working-dir>/create/post

The scripts beginning with 'S' under the above directories would be run before (pre) and after (post) the volume created. The scripts would receive a command line argument as below:
--volname=<volname>

This can be optionally used  by the script.

Version-Release number of selected component (if applicable):


How reproducible:
N/A

Steps to Reproduce:
1.
2.
3.
  
Actual results:
N/A

Expected results:
N/A

Additional info:
Comment 1 Anand Avati 2012-03-31 08:15:14 EDT
CHANGE: http://review.gluster.com/3010 (glusterd: Added init scripts like interface for gluster commands) merged in master by Vijay Bellur (vijay@gluster.com)
Comment 2 Anand Avati 2012-04-09 12:23:25 EDT
CHANGE: http://review.gluster.com/3111 (glusterd: Modified algo for creating hooks directories.) merged in master by Vijay Bellur (vijay@gluster.com)
Comment 3 Anand Avati 2012-04-19 03:12:43 EDT
CHANGE: http://review.gluster.com/3086 (extras: Added (hook) scripts to start/stop samba on volume start and stop) merged in master by Vijay Bellur (vijay@gluster.com)
Comment 4 Anand Avati 2012-04-19 03:36:33 EDT
CHANGE: http://review.gluster.com/3142 (glusterd: Moved 'hooks' interface code to glusterd-hooks.*) merged in master by Vijay Bellur (vijay@gluster.com)
Comment 5 Anand Avati 2012-04-20 08:56:04 EDT
CHANGE: http://review.gluster.com/3193 (glusterd: Enable hooks for volume set.) merged in master by Vijay Bellur (vijay@gluster.com)
Comment 6 Anand Avati 2012-04-23 08:31:10 EDT
CHANGE: http://review.gluster.com/3211 (glusterfs.spec: Added hook-scripts in server rpm) merged in master by Vijay Bellur (vijay@gluster.com)
Comment 7 Anand Avati 2012-05-03 01:56:45 EDT
CHANGE: http://review.gluster.com/3188 (extras: Added hook script to help in CTDB setup) merged in master by Vijay Bellur (vijay@gluster.com)
Comment 8 Anand Avati 2012-05-04 00:26:14 EDT
CHANGE: http://review.gluster.com/3260 (glusterd: Added glusterd command specific optional args for hooks scripts.) merged in master by Vijay Bellur (vijay@gluster.com)
Comment 9 Anand Avati 2012-05-04 02:49:20 EDT
CHANGE: http://review.gluster.com/3271 (extras/hook-scripts: Fixed EXTRA_DIST to explicitly list *.sh files) merged in master by Vijay Bellur (vijay@gluster.com)
Comment 10 Rachana Patel 2012-06-08 06:40:33 EDT
Scripts are there and working as per the expectation.

Not always reproducible but in many case 'S29CTDBsetup.sh' fail to mount replicated volume on 'Gluster/lock', because of that changing status to 'On-dev'


(let me know, If I have to close this defect and log a new for the same as other scripts are working fine)
Comment 11 Amar Tumballi 2012-06-08 08:07:28 EDT
Hi Rachana,

I think you can verify this bug and open another bug. That was we can track the issues specifically.

-Amar
Comment 12 Rachana Patel 2012-06-11 05:40:39 EDT
Scripts are there and working as per the expectation.
Comment 13 Anand Avati 2013-04-24 06:24:36 EDT
REVIEW: http://review.gluster.org/3471 (extras: Restructuring hook-scripts directory) posted (#3) for review on master by Krutika Dhananjay (kdhananj@redhat.com)
Comment 14 Anand Avati 2013-04-24 06:25:14 EDT
REVIEW: http://review.gluster.org/4882 (extras: Move ufo hook-script under the appropriate directory) posted (#1) for review on master by Krutika Dhananjay (kdhananj@redhat.com)
Comment 15 Anand Avati 2013-04-24 08:17:41 EDT
REVIEW: http://review.gluster.org/3471 (extras: Restructuring hook-scripts directory) posted (#4) for review on master by Krutika Dhananjay (kdhananj@redhat.com)
Comment 16 Anand Avati 2013-04-24 11:22:43 EDT
REVIEW: http://review.gluster.org/4882 (extras: Move ufo hook-script under the appropriate directory) posted (#2) for review on master by Krutika Dhananjay (kdhananj@redhat.com)
Comment 17 Anand Avati 2013-04-24 11:23:02 EDT
REVIEW: http://review.gluster.org/3471 (extras: Restructuring hook-scripts directory) posted (#5) for review on master by Krutika Dhananjay (kdhananj@redhat.com)
Comment 18 Anand Avati 2013-05-07 03:42:58 EDT
REVIEW: http://review.gluster.org/4882 (extras: Move ufo hook-script under the appropriate directory) posted (#3) for review on master by Krutika Dhananjay (kdhananj@redhat.com)
Comment 19 Anand Avati 2013-05-07 03:44:18 EDT
REVIEW: http://review.gluster.org/3471 (extras: Restructuring hook-scripts directory) posted (#6) for review on master by Krutika Dhananjay (kdhananj@redhat.com)
Comment 20 Anand Avati 2013-05-08 11:58:58 EDT
REVIEW: http://review.gluster.org/4882 (extras: Move ufo hook-script under the appropriate directory) posted (#4) for review on master by Krutika Dhananjay (kdhananj@redhat.com)
Comment 21 Anand Avati 2013-05-08 11:59:19 EDT
REVIEW: http://review.gluster.org/3471 (extras: Restructuring hook-scripts directory) posted (#7) for review on master by Krutika Dhananjay (kdhananj@redhat.com)