Patchwork [BUG:2093] nfs: Start nfs process even if portmap registration fails

login
register
Submitter Shehjar Tikoo
Date 2010-11-26 06:15:50
Message ID <1290752150-22015-1-git-send-email-shehjart@gluster.com>
Download mbox | patch
Permalink /patch/5786/
State Accepted
Headers show

Comments

Shehjar Tikoo - 2010-11-26 06:15:50
From: Shehjar Tikoo <shehjart@gluster.com>

It helps to have the process be listed in ps ax|grep output
so that user can get the path to the log from the listed
command line and check what the problem is.

Signed-off-by: Shehjar Tikoo <shehjart@gluster.com>
---
 xlators/nfs/server/src/nfs.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

Patch

diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c
index 001df8e..3291858 100644
--- a/xlators/nfs/server/src/nfs.c
+++ b/xlators/nfs/server/src/nfs.c
@@ -641,15 +641,18 @@  init (xlator_t *this) {
 
         ret = nfs_init_versions (nfs, this);
         if (ret == -1) {
-                gf_log (GF_NFS, GF_LOG_CRITICAL, "Failed to initialize "
+                gf_log (GF_NFS, GF_LOG_ERROR, "Failed to initialize "
                         "protocols");
+                /* Do not return an error on this. If we dont return
+                 * an error, the process keeps running and it helps
+                 * to point out where the log is by doing ps ax|grep gluster.
+                 */
+                ret = 0;
                 goto err;
         }
 
-        ret = 0;
+        gf_log (GF_NFS, GF_LOG_INFO, "NFS service started");
 err:
-        if (ret == 0)
-                gf_log (GF_NFS, GF_LOG_INFO, "NFS service started");
 
         return ret;
 }