diff options
author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2014-05-07 09:29:24 -0400 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2014-05-14 19:36:21 -0700 |
commit | 27482ac4678ce7df56126bb9accfebceab1d9fa8 (patch) | |
tree | 0fc4ec2b8b4d44adb92712238737753fccd176c8 /xlators | |
parent | c1c7ae92a2b6bb7d57270fadd7a5d61c90fa3781 (diff) |
nfs: exit when all volumes are disabled
Instead of triggering 4-5 error logs, when nfs is
disabled for all volumes, exit the process.
backport from 3.5
Change-Id: I191294232f5848a4a01609b477289d628cf89ba5
BUG: 1095330
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/7699
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/nfs/server/src/nfs.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c index 5928425c496..fa52d739b9c 100644 --- a/xlators/nfs/server/src/nfs.c +++ b/xlators/nfs/server/src/nfs.c @@ -518,10 +518,11 @@ nfs_init_state (xlator_t *this) if (!this) return NULL; - if ((!this->children) || (!this->children->xlator)) { - gf_log (GF_NFS, GF_LOG_ERROR, "nfs must have at least one" - " child subvolume"); - return NULL; + if (!this->children) { + gf_log (GF_NFS, GF_LOG_INFO, + "NFS is manually disabled: Exiting"); + /* Nothing for nfs process to do, exit cleanly */ + kill (getpid (), SIGTERM); } nfs = GF_CALLOC (1, sizeof (*nfs), gf_nfs_mt_nfs_state); @@ -738,10 +739,10 @@ nfs_init_state (xlator_t *this) GF_OPTION_INIT (OPT_SERVER_GID_CACHE_TIMEOUT, nfs->server_aux_gids_max_age, uint32, free_foppool); - if (gid_cache_init(&nfs->gid_cache, nfs->server_aux_gids_max_age) < 0) { - gf_log(GF_NFS, GF_LOG_ERROR, "Failed to initialize group cache."); - goto free_foppool; - } + if (gid_cache_init(&nfs->gid_cache, nfs->server_aux_gids_max_age) < 0) { + gf_log(GF_NFS, GF_LOG_ERROR, "Failed to initialize group cache."); + goto free_foppool; + } if (stat("/sbin/rpc.statd", &stbuf) == -1) { gf_log (GF_NFS, GF_LOG_WARNING, "/sbin/rpc.statd not found. " |