]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - debian/nfs-common.init
Imported Debian patch 1.0.9-6
[nfs-utils.git] / debian / nfs-common.init
index 8501601dcfb2e7d4e8caaa74304bc87ae0139fd5..f397e645045719f013acff294905d9ecc885540f 100644 (file)
@@ -1,13 +1,15 @@
 #!/bin/sh
-#
-# nfs-common    This shell script takes care of starting and stopping
-#               common daemons required for NFS clients and servers.
-#
-# chkconfig: 345 20 80
-# description: NFS is a popular protocol for file sharing across \
-#             TCP/IP networks. This service provides NFS file \
-#             locking functionality.
-#
+
+### BEGIN INIT INFO
+# Provides:          nfs-common
+# Required-Start:    $time
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: NFS support files common to client and server
+# Description:       NFS is a popular protocol for file sharing across
+#                   TCP/IP networks. This service provides various
+#                    support functions for NFS mounts.
+### END INIT INFO
 
 # What is this?
 DESC="NFS common utilities"
@@ -74,6 +76,20 @@ done
 
 exec 0<&9 9<&-
 
+#
+# We also need idmapd if we run an NFSv4 server. It's fairly difficult
+# to autodetect whether there are NFSv4 exports or not, and idmapd is not a
+# particularily heavy daemon, so we auto-enable it if we find an /etc/exports
+# file. This does not mean that there are NFSv4 or other mounts active (or
+# even that nfs-kernel-server is installed), but it matches what the "start"
+# condition in nfs-kernel-server's init script does, which has a value in
+# itself.
+#
+if [ -f /etc/exports ]; then
+    AUTO_NEED_IDMAPD=yes
+fi
+
+
 case "$NEED_IDMAPD" in
     yes|no)    
         ;;