Patchwork [1/3] nfs-utils: fix "sh: bad number" error on start/stop of nfsserver

login
register
mail settings
Submitter Paul Eggleton
Date March 18, 2011, 5:21 p.m.
Message ID <fe1b41eb969dd9b2c3e1f80b29eb3dc9b1632671.1300467808.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/1639/
State New, archived
Headers show

Comments

Paul Eggleton - March 18, 2011, 5:21 p.m.
From: Paul Eggleton <paul.eggleton@linux.intel.com>

Adds a test to avoid the "sh: bad number" error message during service
start or stop of nfsserver when there is no NFS_SERVERS value set in
/etc/default/nfsd.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 .../nfs-utils/nfs-utils/nfsserver                  |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
index fe76c51..69c8718 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
@@ -31,7 +31,7 @@  test -x "$NFS_NFSD" || exit 0
 #
 # Default is 8 threads, value is settable between 1 and the truely
 # ridiculous 99
-test "$NFS_SERVERS" -gt 0 && test "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8
+test "$NFS_SERVERS" != "" && test "$NFS_SERVERS" -gt 0 && test "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8
 #
 # The default state directory is /var/lib/nfs
 test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs