From 636f3185bd6b6bd214d64a8fd196f909268e2719 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 29 Oct 2007 18:33:15 +0100 Subject: [PATCH] Imported Debian patch 1.1.1-4 --- debian/changelog | 13 ++++++ debian/major.patch | 19 --------- debian/nfs-common.default | 3 ++ debian/nfs-common.init | 51 ++++++++++++++---------- debian/nfs-kernel-server.default | 4 ++ debian/nfs-kernel-server.init | 33 ++++++++------- debian/patches/08-clarify-unexport.patch | 19 +++++++++ debian/patches/series | 1 + debian/rules | 3 -- 9 files changed, 90 insertions(+), 56 deletions(-) delete mode 100644 debian/major.patch create mode 100644 debian/patches/08-clarify-unexport.patch diff --git a/debian/changelog b/debian/changelog index 30644af..34b54af 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +nfs-utils (1:1.1.1-4) unstable; urgency=low + + * Remove broken hack introduced in 1.1.1-3. + * Fix init script to work if the package has been removed but not purged; + patch adapted from Morita Sho. (Closes: #448251) + * Patch init script to allow not running rpc.statd or rpc.mountd (via + settings in /etc/default/), since they are not needed for an NFSv4-only + setup; patch adapted from David Härdeman. (Closes: #448234) + * Clarify language in the exportfs man page; patch adapted from + David Liontooth. (Closes: #443591) + + -- Steinar H. Gunderson Mon, 29 Oct 2007 18:33:15 +0100 + nfs-utils (1:1.1.1-3) unstable; urgency=low * Fixed "FTBFS: error: called object 'major' is not a function" by diff --git a/debian/major.patch b/debian/major.patch deleted file mode 100644 index f9aca07..0000000 --- a/debian/major.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- utils/mountd/cache.c 2007-10-19 13:07:28.000000000 +1000 -+++ utils/mountd/cache.c 2007-10-22 19:24:07.274232106 +1000 -@@ -36,6 +36,16 @@ - #include "blkid/blkid.h" - #endif - -+#ifdef major /* Might be defined in sys/types.h. */ -+#define HAVE_MAJOR -+#endif -+ -+#ifndef HAVE_MAJOR -+#define major(dev) (((dev) >> 8) & 0xff) -+#define minor(dev) ((dev) & 0xff) -+#define makedev(maj, min) (((maj) << 8) | (min)) -+#endif -+#undef HAVE_MAJOR - - enum nfsd_fsid { - FSID_DEV = 0, diff --git a/debian/nfs-common.default b/debian/nfs-common.default index 2e805f0..52f7f91 100644 --- a/debian/nfs-common.default +++ b/debian/nfs-common.default @@ -2,6 +2,9 @@ # autodetected; this should be sufficient for most people. Valid alternatives # for the NEED_ options are "yes" and "no". +# Do you want to start the statd daemon? It is not needed for NFSv4. +NEED_STATD= + # Options for rpc.statd. # Should rpc.statd listen on a specific port? This is especially useful # when you have a port-based firewall. To use a fixed port, set this diff --git a/debian/nfs-common.init b/debian/nfs-common.init index 2bfa59d..3cbb322 100644 --- a/debian/nfs-common.init +++ b/debian/nfs-common.init @@ -18,6 +18,7 @@ DESC="NFS common utilities" # Read config DEFAULTFILE=/etc/default/nfs-common PREFIX= +NEED_STATD=yes NEED_IDMAPD= NEED_GSSD= PIPEFS_MOUNTPOINT=/var/lib/nfs/rpc_pipefs @@ -28,6 +29,9 @@ fi . /lib/lsb/init-functions +# Exit if required binaries are missing. +[ -x $PREFIX/sbin/rpc.statd ] || exit 0 + # # Parse the fstab file, and determine whether we need idmapd and gssd. (The # /etc/defaults settings, if any, will override our autodetection.) This code @@ -67,7 +71,6 @@ if [ -f /etc/exports ] && grep -q '^[[:space:]]*[^#]*/' /etc/exports; then AUTO_NEED_IDMAPD=yes fi - case "$NEED_IDMAPD" in yes|no) ;; @@ -117,12 +120,14 @@ case "$1" in start) log_daemon_msg "Starting $DESC" - log_progress_msg "statd" - start-stop-daemon --start --oknodo --quiet \ - --exec $PREFIX/sbin/rpc.statd -- $STATDOPTS - if [ $? != 0 ]; then - log_end_msg $? - exit $? + if [ "$NEED_STATD" = yes ]; then + log_progress_msg "statd" + start-stop-daemon --start --oknodo --quiet \ + --exec $PREFIX/sbin/rpc.statd -- $STATDOPTS + if [ $? != 0 ]; then + log_end_msg $? + exit $? + fi fi # Don't start idmapd and gssd if we don't have them (say, if /usr is not @@ -193,29 +198,35 @@ case "$1" in exit $? fi fi - log_progress_msg "statd" - start-stop-daemon --stop --oknodo --quiet \ - --name rpc.statd - if [ $? != 0 ]; then - log_end_msg $? - exit $? - fi + if ["$NEED_STATD" = yes ] + then + log_progress_msg "statd" + start-stop-daemon --stop --oknodo --quiet \ + --name rpc.statd + if [ $? != 0 ]; then + log_end_msg $? + exit $? + fi + fi do_umount $PIPEFS_MOUNTPOINT 2>/dev/null || true log_end_msg 0 ;; status) - if ! pidof rpc.statd >/dev/null + if [ "$NEED_STATD" = yes ] then - echo "rpc.statd not running" - exit 3 + if ! pidof rpc.statd >/dev/null + then + echo "rpc.statd not running" + exit 3 + fi fi if [ "$NEED_GSSD" = yes ] then if ! pidof rpc.gssd >/dev/null then - echo "rpc.statd running, but rpc.gssd halted" + echo "rpc.gssd not running" exit 3 fi fi @@ -224,12 +235,12 @@ case "$1" in then if ! pidof rpc.idmapd >/dev/null then - echo "rpc.statd running, but rpc.idmapd halted" + echo "rpc.idmapd not running" exit 3 fi fi - echo "rpc.statd running" + echo "all daemons running" exit 0 ;; diff --git a/debian/nfs-kernel-server.default b/debian/nfs-kernel-server.default index 365f616..63f5c6c 100644 --- a/debian/nfs-kernel-server.default +++ b/debian/nfs-kernel-server.default @@ -4,6 +4,10 @@ RPCNFSDCOUNT=8 # Runtime priority of server (see nice(1)) RPCNFSDPRIORITY=0 +# Do you want to start the mountd daemon? It is not required for NFSv4. +# Valid alternatives are "yes" and "no"; the default is "yes". +NEED_MOUNTD= + # Options for rpc.mountd. # If you have a port-based firewall, you might want to set up # a fixed port here using the --port option. For more information, diff --git a/debian/nfs-kernel-server.init b/debian/nfs-kernel-server.init index 84f9c4d..06c40e6 100644 --- a/debian/nfs-kernel-server.init +++ b/debian/nfs-kernel-server.init @@ -27,6 +27,7 @@ DEFAULTFILE=/etc/default/nfs-kernel-server RPCNFSDCOUNT=8 RPCNFSDPRIORITY=0 RPCMOUNTDOPTS= +NEED_MOUNTD=yes NEED_SVCGSSD=no RPCSVCGSSDOPTS= PROCNFSD_MOUNTPOINT=/proc/fs/nfsd @@ -114,12 +115,14 @@ case "$1" in fi fi - log_progress_msg "mountd" - start-stop-daemon --start --oknodo --quiet \ - --exec $PREFIX/sbin/rpc.mountd -- $RPCMOUNTDOPTS - if [ $? != 0 ]; then - log_end_msg $? - exit $? + if [ "$NEED_MOUNTD" != "no" ]; then + log_progress_msg "mountd" + start-stop-daemon --start --oknodo --quiet \ + --exec $PREFIX/sbin/rpc.mountd -- $RPCMOUNTDOPTS + if [ $? != 0 ]; then + log_end_msg $? + exit $? + fi fi log_end_msg 0 @@ -130,15 +133,17 @@ case "$1" in stop) log_daemon_msg "Stopping $DESC" - - log_progress_msg "mountd" - start-stop-daemon --stop --oknodo --quiet \ - --name rpc.mountd --user 0 - if [ $? != 0 ]; then - log_end_msg $? - exit $? + + if [ "$NEED_MOUNTD" != "no" ]; then + log_progress_msg "mountd" + start-stop-daemon --stop --oknodo --quiet \ + --name rpc.mountd --user 0 + if [ $? != 0 ]; then + log_end_msg $? + exit $? + fi fi - + if [ "$NEED_SVCGSSD" = "yes" ]; then log_progress_msg "svcgssd" start-stop-daemon --stop --oknodo --quiet \ diff --git a/debian/patches/08-clarify-unexport.patch b/debian/patches/08-clarify-unexport.patch new file mode 100644 index 0000000..9b203b8 --- /dev/null +++ b/debian/patches/08-clarify-unexport.patch @@ -0,0 +1,19 @@ +Index: nfs-utils-1.1.1/utils/exportfs/exportfs.man +=================================================================== +--- nfs-utils-1.1.1.orig/utils/exportfs/exportfs.man ++++ nfs-utils-1.1.1/utils/exportfs/exportfs.man +@@ -167,11 +167,13 @@ all entries listed in + are removed from the kernel export tables, and the file is cleared. This + effectively shuts down all NFS activity. + .P +-To remove individual export entries, one can specify a ++To remove an export to a host, specify a + .I host:/path + pair. This deletes the specified entry from + .B xtab + and removes the corresponding kernel entry (if any). ++To remove one or more exports to several hosts, use ++.BR "exportfs -ua" . + .P + .\" -------------------- Dumping the Export Table ----------------- + .SS Dumping the Export Table diff --git a/debian/patches/series b/debian/patches/series index cce0ff4..7137944 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ +08-clarify-unexport.patch 02-document-debian-init-scripts.patch 03-sm-notify-in-sbin.patch 05-ignore-quota-option.patch diff --git a/debian/rules b/debian/rules index 81659a4..dcd8fb4 100755 --- a/debian/rules +++ b/debian/rules @@ -10,9 +10,6 @@ DEBTMP := $(CURDIR)/debian/tmp build: patch build-stamp build-stamp: dh_testdir -ifeq ($(DEB_HOST_ARCH),arm) - patch -p0 -i debian/major.patch -endif CFLAGS="-g -O2 -Wall" ./configure \ --mandir='$${prefix}/share/man' \ --enable-secure-statd \ -- 2.39.2