diff options
author | Oliver Giles | 2015-07-23 21:12:50 +0200 |
---|---|---|
committer | Oliver Giles | 2015-07-23 21:12:50 +0200 |
commit | f39736f33911d4be0943f4394c9bcbaf37dc9283 (patch) | |
tree | c3754bfeb7aa4397a1d033baf3eb8bd83cad0483 | |
download | aur-f39736f33911d4be0943f4394c9bcbaf37dc9283.tar.gz |
initial commit
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | PKGBUILD | 30 | ||||
-rw-r--r-- | unfsd | 44 | ||||
-rw-r--r-- | unfsd.conf | 88 | ||||
-rw-r--r-- | unfsd.service | 17 |
5 files changed, 200 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..885f6199b0f7 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = unfs3 + pkgdesc = A user-space implementation of the NFSv3 server specification + pkgver = 0.9.22 + pkgrel = 3 + url = http://unfs3.sourceforge.net/ + arch = i686 + arch = x86_64 + license = BSD + makedepends = flex + depends = rpcbind + source = http://downloads.sourceforge.net/project/unfs3/unfs3/0.9.22/unfs3-0.9.22.tar.gz + source = unfsd.conf + source = unfsd + source = unfsd.service + md5sums = ddf679a5d4d80096a59f3affc64f16e5 + md5sums = 7c28cd320ac4868cc6f0ca089fbf2e75 + md5sums = e1010b2da0d5fb962112eed243b2b5ed + md5sums = 4dfcdd618b7b2229d9b6082401a52880 + +pkgname = unfs3 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..885d8cab0c17 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,30 @@ +pkgname=unfs3 +pkgver=0.9.22 +pkgrel=3 +pkgdesc="A user-space implementation of the NFSv3 server specification" +arch=('i686' 'x86_64') +url="http://unfs3.sourceforge.net/" +license=("BSD") +makedepends=("flex") +depends=('rpcbind') +source=("http://downloads.sourceforge.net/project/$pkgname/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz" "unfsd.conf" "unfsd" "unfsd.service") +md5sums=('ddf679a5d4d80096a59f3affc64f16e5' '7c28cd320ac4868cc6f0ca089fbf2e75' 'e1010b2da0d5fb962112eed243b2b5ed' '4dfcdd618b7b2229d9b6082401a52880') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + ./configure --prefix=/usr + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/COPYING" + + cd "$srcdir" + install -Dm755 unfsd "$pkgdir/etc/rc.d/unfsd" + install -Dm644 unfsd.conf "$pkgdir/etc/conf.d/unfsd.conf" + install -Dm644 unfsd.service "$pkgdir/usr/lib/systemd/system/unfsd.service" +} + + diff --git a/unfsd b/unfsd new file mode 100644 index 000000000000..50dc93977eb4 --- /dev/null +++ b/unfsd @@ -0,0 +1,44 @@ +#!/bin/bash +. /etc/rc.conf +. /etc/rc.d/functions + +DAEMON=unfsd +NAME=unfsd +ARGS= + +[ -r /etc/conf.d/$NAME.conf ] && . /etc/conf.d/$NAME.conf + +PID=$(get_pid $DAEMON) + +case "$1" in + start) + ck_daemon rpcbind && { echo -n "Start rpcbind first." >&2; stat_die; } + stat_busy "Starting $NAME" + [ -z "$PID" ] && /usr/sbin/$DAEMON $ARGS + if [ $? = 0 ]; then + add_daemon $NAME + stat_done + else + stat_fail + exit 1 + fi + ;; + stop) + stat_busy "Stopping $NAME" + [ -n "$PID" ] && kill $PID &>/dev/null + if [ $? = 0 ]; then + rm_daemon $NAME + stat_done + else + stat_fail + exit 1 + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac diff --git a/unfsd.conf b/unfsd.conf new file mode 100644 index 000000000000..d4573d01e514 --- /dev/null +++ b/unfsd.conf @@ -0,0 +1,88 @@ +# Defaults for unfs3 (user-space NFSv3 server) + +# Unprivileged port +# Use an unprivileged port for NFS and MOUNT service. Normally, unfsd will use +# port number 2049, which is the standard port for NFS. When this option is in +# effect, arbitrary ports chosen by the RPC library will be used. You may need +# to use this option when running unfsd from a normal user account. +PORT_UNPRIVILEGED="-u" + +# Specified port +# Use the specified port for the NFS service. +PORT_NFS="2049" + +# Specified port (MOUNT service) +# Use the specified port for the MOUNT service. The default is to use port +# number 2049, the same as for the NFS service. You can use the same port for +# both services if you want. +PORT_MOUNT="2049" + +# TCP only operation +# By default, unfsd provides its services to clients using either UDP or TCP as +# communications protocol. When this option is present, only TCP connections are +# serviced. +#TCP_ONLY="-t" + +# Register with the portmapper +# Do not register with the portmapper. This will prevent other hosts from +# finding out the port numbers used for the MOUNT and NFS services by querying +# the portmap daemon. Clients will need to manually specify the port numbers to +# use (on Linux clients, use the mountport and port mount options). +#NO_PORTMAPPER="-p" + +# Expiring write cache +# Allow the built-in file descriptor cache to expire writers. For performance +# reasons, unfsd keeps file descriptors open across multiple READ or WRITE +# requests. Normally, only READ file descriptors will be expired from the cache +# when it fills up. Setting this option allows file descriptors from WRITE +# operations to be expired, too. When this happens, pending data will be +# written to the server filesystem. However, if an error occurs while doing +# this, there is no way to notify the NFS client of the error. A message +# indicating the problem will be sent to the system log on the server. +#NO_WRITE_CACHE="-w" + +# Cluster extensions +# Enable cluster extensions. When this option is enabled, so-called tagged +# files are handled differently from normal files, making it possible to +# serve different file contents to different clients for the same filename. +# See tags(7) for a description of tagged files. This option causes a +# performance hit. +#CLUSTER_EXTENSION="-c" + +# Cluster path +# Limit the use of cluster extensions to a list of colon-seperated directories. +# When this option is present, the performance hit caused by clustering +# extensions only applies to the listed directories and their subdirectories. +#CLUSTER_PATH="-C /" + +# Single user mode +# Activate basic uid translation. This option is useful when the server and +# client are using different user and group ids. All requests from the client +# will be served from the user id that started unfsd, no user id switching will +# take place (even if unfsd was started by root). Ownership is reported as +# follows: files belonging to the user id running unfsd will look as if they +# are owned by the client's user. Other files will look as if they are owned by +# root. The same principle applies to group ownership. +#SINGLE_USER="-s" + +# Brute force file searching +# Normally, when you rename a file across several directories on an NFS volume, +# the filehandle for that file becomes stale. When this option is enabled, unfsd +# will attempt a recursive search on the relevant server filesystem to find the +# file referenced by the filehandle. This can have a huge performance impact as +# this will also happen for files that were really deleted (by another NFS +# client) instead of moved, and cannot be found. +#BRUTE_FORCE="-b" + +# Bind to interface with specified address +# The default is to bind to all local interfaces. +#INTERFACE="-l 127.0.0.1" + +# Debug mode +# When this option is present, unfsd will not fork into the background at +# startup, and all messages that would normally go to the system log go to +# stdout instead. +#DEBUG="-d" + +# Additional options that are passed to the Daemon. +ARGS="$PORT_UNPRIVILEGED -n $PORT_NFS -m $PORT_MOUNT $TCP_ONLY $NO_PORTMAPPER $NO_WRITE_CACHE $CLUSTER_EXTENSION $CLUSTER_PATH $SINGLE_USER $BRUTE_FORCE $INTERFACE $DEBUG" diff --git a/unfsd.service b/unfsd.service new file mode 100644 index 000000000000..d042ff1eea6e --- /dev/null +++ b/unfsd.service @@ -0,0 +1,17 @@ +[Unit] +Description=Userspace NFSv3 Server +Requires=rpcbind.service +After=rpcbind.service + +[Service] +Type=forking +EnvironmentFile=/etc/conf.d/unfsd.conf +PIDFile=/run/unfsd.pid +ExecStart=/usr/sbin/unfsd -i /run/unfsd.pid $PORT_UNPRIVILEGED -n $PORT_NFS -m $PORT_MOUNT $TCP_ONLY $NO_PORTMAPPER $NO_WRITE_CACHE $CLUSTER_EXTENSION $CLUSTER_PATH $SINGLE_USER $BRUTE_FORCE $INTERFACE $DEBUG +ExecReload=/bin/kill -HUP $MAINPID +KillMode=process +Restart=always + +[Install] +WantedBy=multi-user.target + |