# HG changeset patch # User Pascal Bellard # Date 1289900789 -3600 # Node ID 4d60a47b5df08c760884b0af99736c326af70f29 # Parent 1fbd398aaaf423fbce4a33201ec46831aae41b97 nfs-utils: add /etc/init.d/nfsd diff -r 1fbd398aaaf4 -r 4d60a47b5df0 nfs-utils/receipt --- a/nfs-utils/receipt Tue Nov 16 03:59:56 2010 +0000 +++ b/nfs-utils/receipt Tue Nov 16 10:46:29 2010 +0100 @@ -8,8 +8,9 @@ TARBALL="$PACKAGE-$VERSION.tar.bz2" WEB_SITE="http://nfs.sourceforge.net/" WGET_URL="$SF_MIRROR/nfs/$PACKAGE/$VERSION/$TARBALL" -DEPENDS="libtirpc libwrap util-linux-ng-blkid util-linux-ng-uuid" +DEPENDS="libtirpc libwrap util-linux-ng-blkid util-linux-ng-uuid rpcbind" BUILD_DEPENDS="libtirpc-dev util-linux-ng-blkid-dev libcap-dev" +CONFIG_FILES="/etc/exports" TAGS="filesystem" # Rules to configure and make the package. @@ -28,7 +29,17 @@ genpkg_rules() { mkdir -p $fs/usr + cp -a stuff/* $fs cp -a $_pkg/var $fs cp -a $_pkg/sbin $fs cp -a $_pkg/usr/sbin $fs/usr } + +post_install() +{ + grep ^nfs $1/etc/services || + sed -i 's|.* 2401/tcp.*|nfs 2049/tcp\nnfs 2049/udp\n&|' $1/etc/services + [ -s $1/etc/exports ] || cat > $1/etc/exports < /dev/null + /usr/sbin/exportfs -r + $DAEMON $OPTION + pidof nfsd | awk '{print $1}' > $PID_FILE + /usr/sbin/rpc.mountd + status + ;; + stop) + if ! active_pidfile $PID_FILE nfsd ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Stopping $DESC: $NAME... " + killall rpc.mountd + killall nfsd + killall lockd + /usr/sbin/exportfs -au + /usr/sbin/exportfs -f + stop_warning # FIXME + rm $PID_FILE + status + ;; + restart) + if ! active_pidfile $PID_FILE nfsd ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Restarting $DESC: $NAME... " + killall rpc.mountd + killall nfsd + killall lockd + /usr/sbin/exportfs -au + /usr/sbin/exportfs -f + sleep 2 + /usr/sbin/exportfs -r + $DAEMON $OPTION + pidof nfsd | awk '{print $1}' > $PID_FILE + /usr/sbin/rpc.mountd + status + ;; + *) + echo "" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" + echo "" + exit 1 + ;; +esac + +exit 0