nfsd: accept config to set number of threads
authorAndreas Ehmanns <universeII@gmx.de>
Thu, 17 Dec 2015 19:45:05 +0000 (20:45 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thu, 17 Dec 2015 20:51:42 +0000 (21:51 +0100)
[Thomas: tweak commit title and author.]

Signed-off-by: Andreas Ehmanns <universeII@gmx.de>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/nfs-utils/S60nfs

index ec7c909d47a176c027cf2cbe9379ea8068694b76..5639b8f7e2e51d99671b2d0e2d5a886d32cc422c 100755 (executable)
@@ -13,6 +13,14 @@ mkdir -p /run/nfs/sm
 mkdir -p /run/nfs/sm.bak
 touch /run/nfs/rmtab
 
+CFG_FILE=/etc/default/nfsd
+
+NR_THREADS=2
+if [ -f "${CFG_FILE}" ]; then
+    . "${CFG_FILE}"
+fi
+
+
 start() {
        # Start daemons.
        printf "Starting NFS statd: "
@@ -25,7 +33,7 @@ start() {
        echo "done"
 
        printf "Starting NFS daemon: "
-       rpc.nfsd 2
+       rpc.nfsd ${NR_THREADS}
        echo "done"
 
        printf "Starting NFS mountd: "
@@ -40,7 +48,7 @@ stop() {
        killall -q rpc.mountd
        echo "done"
 
-       echo "Shutting down NFS daemon: "
+       printf "Shutting down NFS daemon: "
        kill -9 `pidof nfsd` 2>/dev/null
        echo "done"