diff mbox

(revised) nfs-utils: start-statd script using incompatible file descriptor

Message ID 1d86b6dd-8d63-c66a-0eca-0333873dfdf0@pocock.pro (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Pocock Dec. 17, 2016, 7:12 p.m. UTC
The current script uses fd 200, doesn't work for every possible shell as
reported[1] in Debian bug #848277

We are including a patch for it in the 1.3.4-2 package, it would be good
to incorporate this patch upstream too.

This patch has been revised to include a brief description and
signed-off-by.

Regards,

Daniel


1. https://bugs.debian.org/848277
diff mbox

Patch

POSIX.1-2008 only specifies that file descriptor numbers
from 0 to 9, inclusive, are supported.  The number 200 works
in the bash shell, but not in dash.  This patch changes the file
descriptor number from 200 to 9.  Reported in Debian bug #848277

Signed-off-by: Daniel Pocock <daniel@pocock.pro>
---

diff --git a/utils/statd/start-statd b/utils/statd/start-statd
index 2fd6039..82715b4 100755
--- a/utils/statd/start-statd
+++ b/utils/statd/start-statd
@@ -7,8 +7,8 @@ 
 PATH="/sbin:/usr/sbin:/bin:/usr/bin"
 
 # Use flock to serialize the running of this script
-exec 200> /var/run/rpc.statd.lock
-flock -e 200
+exec 9> /var/run/rpc.statd.lock
+flock -e 9
 
 if [ -s /var/run/rpc.statd.pid ] &&
        [ 1`cat /var/run/rpc.statd.pid` -gt 1 ] &&