Bug#620421: nfs-kernel-server: init script depends on non-existent ‘/dev/tcp/’
Package: nfs-kernel-server
Version: 1:1.2.2-5
Severity: important
Tags: patch
The ‘/etc/init.d/nfs-kernel-server’ script has a new dependency on a
non-existent directory:
=====
# See if portmap or rpcbind are running
(cat </dev/null >/dev/tcp/localhost/111) 2>/dev/null
RET=$?
if [ $RET != 0 ]; then
echo
log_warning_msg "Not starting: portmap daemon is not running"
exit 0
fi
=====
This results in the script failing, with “Not starting: portmap daemon
is not running”.
That's nothing to do with the portmapper service. It's because there is
no such directory ‘/dev/tcp/’ on this machine:
$ ls /dev/tcp/
ls: cannot access /dev/tcp/: No such file or directory
To check for the portmapper service, the ‘rpcinfo(1)’ tool is provided.
Using that program, we can see that the service is running on this
machine:
$ rpcinfo -t localhost portmapper
program 100000 version 2 ready and waiting
The following patch uses this test, which works in current “Wheezy”.
=== modified file 'init.d/nfs-kernel-server'
--- old/init.d/nfs-kernel-server 2011-04-01 12:03:38 +0000
+++ new/init.d/nfs-kernel-server 2011-04-01 19:51:56 +0000
@@ -84,7 +84,7 @@
log_progress_msg "nfsd"
- # See if portmap or rpcbind are running
- (cat </dev/null >/dev/tcp/localhost/111) 2>/dev/null
+ # See if the portmapper service is running.
+ (rpcinfo -t localhost portmapper) >/dev/null 2>/dev/null
RET=$?
if [ $RET != 0 ]; then
echo
-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (990, 'testing'), (900, 'stable')
Architecture: powerpc (ppc64)
Kernel: Linux 2.6.32-5-powerpc64 (SMP w/2 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_AU.utf8)
Shell: /bin/sh linked to /bin/dash
Versions of packages nfs-kernel-server depends on:
ii libblkid1 2.17.2-9.1 block device id library
ii libc6 2.11.2-11 Embedded GNU C Library: Shared lib
ii libcomerr2 1.41.12-2 common error description library
ii libgssapi-krb5-2 1.8.3+dfsg-4 MIT Kerberos runtime libraries - k
ii libgssglue1 0.1-4 mechanism-switch gssapi library
ii libk5crypto3 1.8.3+dfsg-4 MIT Kerberos runtime libraries - C
ii libkrb5-3 1.8.3+dfsg-4 MIT Kerberos runtime libraries
ii libnfsidmap2 0.24-1 An nfs idmapping library
ii librpcsecgss3 0.19-2 allows secure rpc communication us
ii libwrap0 7.6.q-19 Wietse Venema's TCP wrappers libra
ii lsb-base 3.2-27 Linux Standard Base 3.2 init scrip
ii nfs-common 1:1.2.2-5 NFS support files common to client
ii ucf 3.0025+nmu1 Update Configuration File: preserv
nfs-kernel-server recommends no packages.
nfs-kernel-server suggests no packages.
-- no debconf information
Reply to: