diff options
author | Krishnan Parthasarathi <kp@gluster.com> | 2012-03-26 16:11:29 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-03-31 05:15:08 -0700 |
commit | 66d430da4e3788aeb41eea46455ca25a2d19a626 (patch) | |
tree | b52c1189401cc47c7cfecc7e5225938b926b6a4d /xlators/mgmt/glusterd/src/glusterd.c | |
parent | 3f81c44a03e9ab78be2b4a69e3e36d41a4de324a (diff) |
glusterd: Added init scripts like interface for gluster commands
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>/hooks/version/create/pre
<glusterd-working-dir>/hooks/version/create/post
where, version corresponds to the version of hook scripts.
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.
Change-Id: Ia81b4ff9dd4477d99dd59b39c805aa645521edb0
BUG: 806996
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/3010
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Csaba Henk <csaba@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c index e4f04002f09..b84c141df9a 100644 --- a/xlators/mgmt/glusterd/src/glusterd.c +++ b/xlators/mgmt/glusterd/src/glusterd.c @@ -795,6 +795,7 @@ init (xlator_t *this) " ,errno = %d", dirname, errno); exit (1); } + first_time = 1; } @@ -977,6 +978,15 @@ init (xlator_t *this) if (ret < 0) goto out; + if (first_time) { + ret = glusterd_store_create_hooks_directory (dirname); + if (-1 == ret) { + gf_log (this->name, GF_LOG_CRITICAL, + "Unable to create hooks directory "); + exit (1); + } + } + INIT_LIST_HEAD (&conf->mount_specs); dict_foreach (this->options, _install_mount_spec, &ret); if (ret) |