X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=debian%2Fnfs-kernel-server.init;h=7ce79f5a814a33d351b5abb9eeb8cf678a6eb234;hb=553b03c758371c0e082aa7dde5702fa664b3a73b;hp=b7a9633151a0a79332dcf41b222c6a5f7ba11fea;hpb=db454c10e20488033aa5c03722c4bd8167206cf7;p=nfs-utils.git diff --git a/debian/nfs-kernel-server.init b/debian/nfs-kernel-server.init index b7a9633..7ce79f5 100644 --- a/debian/nfs-kernel-server.init +++ b/debian/nfs-kernel-server.init @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash ### BEGIN INIT INFO # Provides: nfs-kernel-server @@ -60,7 +60,13 @@ do_mount() { # See how we were called. case "$1" in start) - if [ -f /etc/exports ] + export_files="/etc/exports" + for file in /etc/exports.d/*.exports ; do + if [ -f "$file" ]; then + export_files="$export_files $file" + fi + done + if [ -f /etc/exports ] && grep -q '^[[:space:]]*[^#]*/' $export_files then do_modprobe nfsd @@ -83,12 +89,12 @@ case "$1" in log_daemon_msg "Starting $DESC" log_progress_msg "nfsd" - # See if portmap or rpcbind are running - lsof -i :111 >/dev/null + # See if rpcbind is running + $PREFIX/sbin/rpcinfo -p >/dev/null 2>&1 RET=$? if [ $RET != 0 ]; then echo - log_warning_msg "Not starting: portmap daemon is not running" + log_warning_msg "Not starting: portmapper is not running" exit 0 fi @@ -111,7 +117,7 @@ case "$1" in } fi - $PREFIX/bin/rpcinfo -u localhost nfs 3 >/dev/null 2>&1 || + $PREFIX/sbin/rpcinfo -u localhost nfs 3 >/dev/null 2>&1 || RPCMOUNTDOPTS="$RPCMOUNTDOPTS --no-nfs-version 3" [ -z "$ClearAddr" ] || echo "nfsd 127.0.0.1 1" >/proc/net/rpc/auth.unix.ip/channel