On Sun, 29 Dec 2002, Pavel Tsekov wrote:

> Attached is a modified nfs-server-config script which works fine.


Ooops, forgot the attachment. Here it is.

#!/bin/sh
#
# nfs-server-config
#
# This file is part of the Cygwin port of the Universal NFS Server
#
# TODO: Should ask the user how they would like to install
# the NFS server - as Windows service, or under inetd.
#
# For now, assumes an NT/W2K install, and installs things
# as services.

# Stop and uninstall portmap service
cygrunsrv.exe --stop "portmap" > /dev/null 2>&1
cygrunsrv.exe --remove "portmap" > /dev/null 2>&1

# Stop and uninstall mountd service
cygrunsrv.exe --stop "mountd" > /dev/null 2>&1
cygrunsrv.exe --remove "mountd" > /dev/null 2>&1

# Stop and uninstall nfsd service
cygrunsrv.exe --stop "nfsd" > /dev/null 2>&1
cygrunsrv.exe --remove "nfsd" > /dev/null 2>&1

# Install services
cygrunsrv.exe --install "portmap" -p /usr/sbin/portmap -a -F
cygrunsrv.exe --install "mountd"  -p /usr/sbin/rpc.mountd --dep portmap -a -F
cygrunsrv.exe --install "nfsd"    -p /usr/sbin/rpc.nfsd --dep portmap -a -F

# Create sample /etc/exports (ony if it does not already exist)
if [ ! -f /etc/exports ]; then
        cat > /etc/exports <<- "EOF"
                # sample /etc/exports file

                # Export the entire Cygwin filesystem to machines master and
                # trusty. In addition to write access, all uid squashing is
                # turned off for host trusty.

                # /                                     master(rw) 
trusty(rw,no_root_squash)

                # Example of wildcard hostnames.

                # /projects                     proj*.local.domain(rw)

                # Example of wildcard netgroups (this is the entry `@trusted').

                # /usr                          *.local.domain(ro) @trusted(rw)

                # Gives read-only access to the host grimjack.  The UID and GID
                # for anonymous requests are explicitly set, and all requests
                # are forced to use the anonymous UID/GID.

                # /home/joe                     
grimjack(ro,all_squash,anonuid=501,anongid=546)

                # Give read-write access to anyone, and force all requests to
                # use the default anonymous UID/GID. The insecure option in this
                # entry also allows clients with NFS implementations that don't
                # use a reserved port for NFS.

                # /pub                          (ro,all_squash)

                # Deny all NFS users access to the private directory that exists
                # under the public directory.

                # /pub/private          (noaccess)
        EOF
fi

Reply via email to