summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-04-27 00:01:30 +0000
committerroot <root@rshg054.dnsready.net>2012-04-27 00:01:30 +0000
commit5233daa5825f00ccf0722ef9733ea6b3bbd44bc8 (patch)
tree9efe4d061ff3f921e97518a8bc84d504bc88e6fc /testing
parent4a6f4c864badccdbf9756bc45218273796fa6d72 (diff)
Fri Apr 27 00:01:30 UTC 2012
Diffstat (limited to 'testing')
-rw-r--r--testing/inetutils/PKGBUILD69
-rw-r--r--testing/inetutils/dnsdomainname3
-rw-r--r--testing/inetutils/ftpd.conf4
-rw-r--r--testing/inetutils/ftpd.rc37
-rw-r--r--testing/inetutils/inetutils.install20
-rw-r--r--testing/inetutils/rlogin.xinetd10
-rw-r--r--testing/inetutils/rsh.xinetd10
-rw-r--r--testing/inetutils/talk.xinetd10
-rw-r--r--testing/inetutils/telnet.xinetd10
-rw-r--r--testing/nfs-utils/PKGBUILD101
-rw-r--r--testing/nfs-utils/exports15
-rw-r--r--testing/nfs-utils/idmapd.conf14
-rw-r--r--testing/nfs-utils/nfs40
-rw-r--r--testing/nfs-utils/nfs-common315
-rw-r--r--testing/nfs-utils/nfs-common.conf40
-rw-r--r--testing/nfs-utils/nfs-server299
-rw-r--r--testing/nfs-utils/nfs-server.conf29
-rw-r--r--testing/nfs-utils/nfs-utils-1.1.4-mtab-sym.patch39
-rw-r--r--testing/nfs-utils/nfs-utils-1.1.4-no-exec.patch15
-rw-r--r--testing/nfs-utils/nfs-utils.conf1
-rw-r--r--testing/nfs-utils/nfs-utils.install32
-rw-r--r--testing/nfs-utils/nfsd.service16
-rw-r--r--testing/nfs-utils/proc-fs-nfsd.mount8
-rw-r--r--testing/nfs-utils/rpc-gssd.service12
-rw-r--r--testing/nfs-utils/rpc-idmapd.service12
-rw-r--r--testing/nfs-utils/rpc-mountd.service12
-rw-r--r--testing/nfs-utils/rpc-statd.service12
-rw-r--r--testing/nfs-utils/rpc-svcgssd.service12
-rw-r--r--testing/nfs-utils/start-statd.patch22
-rw-r--r--testing/nfs-utils/var-lib-nfs-rpc_pipefs.mount7
-rw-r--r--testing/samba/PKGBUILD166
-rw-r--r--testing/samba/nmbd.service8
-rwxr-xr-xtesting/samba/samba57
-rw-r--r--testing/samba/samba.conf.d7
-rw-r--r--testing/samba/samba.logrotate9
-rw-r--r--testing/samba/samba.pam3
-rw-r--r--testing/samba/smbd.conf1
-rw-r--r--testing/samba/smbd.service9
-rw-r--r--testing/samba/swat.xinetd10
-rw-r--r--testing/samba/winbindd.service9
40 files changed, 1505 insertions, 0 deletions
diff --git a/testing/inetutils/PKGBUILD b/testing/inetutils/PKGBUILD
new file mode 100644
index 000000000..4a53f7f27
--- /dev/null
+++ b/testing/inetutils/PKGBUILD
@@ -0,0 +1,69 @@
+# $Id: PKGBUILD 157204 2012-04-25 19:44:02Z eric $
+# Maintainer: Eric BĂ©langer <eric@archlinux.org>
+
+pkgname=inetutils
+pkgver=1.9.1
+pkgrel=2
+pkgdesc="A collection of common network programs"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/inetutils/"
+license=('GPL3')
+groups=('base')
+depends=('readline' 'ncurses' 'pam')
+backup=('etc/conf.d/ftpd' 'etc/xinetd.d/telnet' 'etc/xinetd.d/talk' \
+ 'etc/xinetd.d/rlogin' 'etc/xinetd.d/rsh')
+options=('!emptydirs')
+install=inetutils.install
+source=(http://ftp.gnu.org/gnu/inetutils/${pkgname}-${pkgver}.tar.gz{,.sig} \
+ ftpd.rc ftpd.conf telnet.xinetd talk.xinetd rlogin.xinetd rsh.xinetd \
+ dnsdomainname)
+sha1sums=('86b7eb11cfdaefb1d4e9bfc10620beaf8f09bc90'
+ 'ff0aad9946a38915580b094dadf67e790e8a2f87'
+ '84dc802b5e57b5e04c847572225a3b9612017155'
+ '68a590083b45997dfdb80e666b2de762f494ba74'
+ 'bfad98a4a62f1fff8779f076c6019ed07f9111af'
+ '27d99b910eec0fc26bd79ccc2c1de26608330298'
+ '81f10b3b688e3952f793b35bcef63b5bf257a92b'
+ '81f4a8da823cf0bb14284fc71ee6108849691eda'
+ 'eb952b0b9c3e3d429d8e21b110249e495f0e0e63')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --prefix=/usr --libexec=/usr/sbin --localstatedir=/var \
+ --sysconfdir=/etc --mandir=/usr/share/man --infodir=/usr/share/info \
+ --without-wrap --with-pam \
+ --enable-ftp --enable-ftpd \
+ --enable-telnet --enable-telnetd \
+ --enable-talk --enable-talkd \
+ --enable-rlogin --enable-rlogind \
+ --enable-rsh --enable-rshd \
+ --enable-rcp --enable-hostname \
+ --disable-rexec --disable-rexecd \
+ --disable-tftp --disable-tftpd \
+ --disable-ping --disable-ping6 \
+ --disable-logger --disable-syslogd \
+ --disable-inetd --disable-whois \
+ --disable-uucpd --disable-ifconfig --disable-traceroute
+ make
+}
+
+check() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make check
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+
+ install -d "${pkgdir}/bin"
+ ln -s /usr/bin/hostname "${pkgdir}/bin/hostname"
+ install -D -m755 "${srcdir}/dnsdomainname" "${pkgdir}/bin/dnsdomainname"
+ echo ".so man1/hostname.1" > "${pkgdir}/usr/share/man/man1/dnsdomainname.1"
+ install -D -m755 "${srcdir}/ftpd.rc" "${pkgdir}/etc/rc.d/ftpd"
+ install -D -m644 "${srcdir}/ftpd.conf" "${pkgdir}/etc/conf.d/ftpd"
+ install -D -m644 "${srcdir}/telnet.xinetd" "${pkgdir}/etc/xinetd.d/telnet"
+ install -D -m644 "${srcdir}/talk.xinetd" "${pkgdir}/etc/xinetd.d/talk"
+ install -D -m644 "${srcdir}/rlogin.xinetd" "${pkgdir}/etc/xinetd.d/rlogin"
+ install -D -m644 "${srcdir}/rsh.xinetd" "${pkgdir}/etc/xinetd.d/rsh"
+}
diff --git a/testing/inetutils/dnsdomainname b/testing/inetutils/dnsdomainname
new file mode 100644
index 000000000..a1b8a8c31
--- /dev/null
+++ b/testing/inetutils/dnsdomainname
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /usr/bin/hostname -d "$@"
diff --git a/testing/inetutils/ftpd.conf b/testing/inetutils/ftpd.conf
new file mode 100644
index 000000000..f660f0035
--- /dev/null
+++ b/testing/inetutils/ftpd.conf
@@ -0,0 +1,4 @@
+#
+# Parameters to be passed to ftpd
+#
+FTPD_ARGS=""
diff --git a/testing/inetutils/ftpd.rc b/testing/inetutils/ftpd.rc
new file mode 100644
index 000000000..3d0d34421
--- /dev/null
+++ b/testing/inetutils/ftpd.rc
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/ftpd
+
+PID=$(pidof -o %PPID /usr/sbin/ftpd)
+case "$1" in
+ start)
+ stat_busy "Starting ftpd"
+ [ -z "$PID" ] && /usr/sbin/ftpd -D $FTPD_ARGS
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon ftpd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping ftpd"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon ftpd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/testing/inetutils/inetutils.install b/testing/inetutils/inetutils.install
new file mode 100644
index 000000000..b338fa498
--- /dev/null
+++ b/testing/inetutils/inetutils.install
@@ -0,0 +1,20 @@
+infodir=/usr/share/info
+filelist=(inetutils.info.gz)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info $infodir/$file $infodir/dir 2> /dev/null
+ done
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info --delete $infodir/$file $infodir/dir 2> /dev/null
+ done
+}
diff --git a/testing/inetutils/rlogin.xinetd b/testing/inetutils/rlogin.xinetd
new file mode 100644
index 000000000..5c72f86df
--- /dev/null
+++ b/testing/inetutils/rlogin.xinetd
@@ -0,0 +1,10 @@
+service login
+{
+ flags = REUSE
+ socket_type = stream
+ wait = no
+ user = root
+ server = /usr/sbin/rlogind
+ log_on_failure += USERID
+ disable = yes
+}
diff --git a/testing/inetutils/rsh.xinetd b/testing/inetutils/rsh.xinetd
new file mode 100644
index 000000000..a13738c31
--- /dev/null
+++ b/testing/inetutils/rsh.xinetd
@@ -0,0 +1,10 @@
+service shell
+{
+ flags = REUSE
+ socket_type = stream
+ wait = no
+ user = root
+ server = /usr/sbin/rshd
+ log_on_failure += USERID
+ disable = yes
+}
diff --git a/testing/inetutils/talk.xinetd b/testing/inetutils/talk.xinetd
new file mode 100644
index 000000000..6abef359c
--- /dev/null
+++ b/testing/inetutils/talk.xinetd
@@ -0,0 +1,10 @@
+service ntalk
+{
+ flags = REUSE
+ socket_type = dgram
+ wait = yes
+ user = root
+ server = /usr/sbin/talkd
+ log_on_failure += USERID
+ disable = yes
+}
diff --git a/testing/inetutils/telnet.xinetd b/testing/inetutils/telnet.xinetd
new file mode 100644
index 000000000..bd3a5e4b1
--- /dev/null
+++ b/testing/inetutils/telnet.xinetd
@@ -0,0 +1,10 @@
+service telnet
+{
+ flags = REUSE
+ socket_type = stream
+ wait = no
+ user = root
+ server = /usr/sbin/telnetd
+ log_on_failure += USERID
+ disable = yes
+}
diff --git a/testing/nfs-utils/PKGBUILD b/testing/nfs-utils/PKGBUILD
new file mode 100644
index 000000000..09e3b8aa1
--- /dev/null
+++ b/testing/nfs-utils/PKGBUILD
@@ -0,0 +1,101 @@
+# $Id: PKGBUILD 157200 2012-04-25 16:11:10Z tpowa $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: John Proctor <jproctor@prium.net>
+# Contributor: dibblethewrecker <dibblethewrecker.at.jiwe.org>
+# Contributor: abelstr <abel@pinklf.eu>
+# Contributor: Marco Lima <cipparello gmail com>
+
+pkgname=nfs-utils
+pkgver=1.2.5
+pkgrel=4
+pkgdesc="Support programs for Network File Systems"
+arch=('i686' 'x86_64')
+url='http://nfs.sourceforge.net'
+license=('GPL')
+backup=(etc/{exports,idmapd.conf,nfsmount.conf} etc/conf.d/{nfs-common.conf,nfs-server.conf})
+depends=('glibc' 'e2fsprogs' 'rpcbind' 'libtirpc>=0.2.1' 'librpcsecgss>=0.19-2' 'nfsidmap' 'libevent>=2.0.10' 'libgssglue' 'device-mapper')
+makedepends=('pkgconfig' 'autoconf' 'automake')
+source=(http://downloads.sourceforge.net/project/nfs/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.bz2
+ nfs-common
+ nfs-common.conf
+ nfs-server
+ nfs-server.conf
+ exports
+ idmapd.conf
+ start-statd.patch
+ nfs
+ nfs-utils-1.1.4-mtab-sym.patch
+ nfs-utils-1.1.4-no-exec.patch
+ rpc-gssd.service
+ rpc-mountd.service
+ rpc-svcgssd.service
+ rpc-idmapd.service
+ rpc-statd.service
+ nfsd.service
+ var-lib-nfs-rpc_pipefs.mount
+ proc-fs-nfsd.mount
+ nfs-utils.conf)
+install=nfs-utils.install
+md5sums=('8395ac770720b83c5c469f88306d7765'
+ 'dd0d65fc6e8f422fa12520813098264b'
+ 'f73f197a16b02c3e248488ec35c4cf43'
+ 'e619f18354ff958ed624d05d08853d8f'
+ '9cef69bc686cc5dcac23fbb51450747d'
+ 'ff585faf410a62c4333a027c50b56bae'
+ 'eb4f4027fab6fc1201f1ca04f5954c76'
+ 'e9144277a89a620d9bc80413158a7d27'
+ 'f5e7bba09a46c5c5d7007cac6eff9df5'
+ '7674106eaaa4c149bccd4f05fe3604e9'
+ '4f4827dfc93008dfadd0a530ad0872b2'
+ '38855936dc55a5afe37d84edc0f11066'
+ '8d888de677a217c5e5f7244a2e3a2d3a'
+ 'e05705d9ccccaeaeb1ecaee20adc05bc'
+ 'd7df7bc311fd95c5b80017dd1741570d'
+ '2e72ee082cba5d3ec6f51d2a105664da'
+ '5d33d2e754fd37280365b287603bac90'
+ '1cd65909fa0983047f3f06a3ab352401'
+ '02a34835aa077146a90eb7d191e612d0'
+ '8ac484023d786766d287ccbe878ae4ba')
+
+build() {
+ cd $srcdir/${pkgname}-${pkgver}
+ patch -Np1 -i ../nfs-utils-1.1.4-mtab-sym.patch
+ #patch -Np1 -i ../nfs-utils-1.1.4-no-exec.patch
+ # arch specific patch
+ patch -Np0 -i $srcdir/start-statd.patch
+
+ ./configure --prefix=/usr --enable-nfsv4 --enable-nfsv41 --enable-gss \
+ --without-tcp-wrappers --with-statedir=/var/lib/nfs \
+ --enable-ipv6 --sysconfdir=/etc --enable-libmount-mount \
+ --enable-mountconfig
+
+ make
+}
+
+package() {
+ cd $srcdir/${pkgname}-${pkgver}
+ make DESTDIR=$pkgdir install
+
+ # support python2 (FS#25120)
+ sed -i '1s/python$/python2/' "$pkgdir"/usr/sbin/{nfsiostat,mountstats}
+
+ # NFS & NFSv4 init scripts
+ install -D -m 755 ../nfs-common "$pkgdir/"etc/rc.d/nfs-common
+ install -D -m 755 ../nfs-server "$pkgdir/"etc/rc.d/nfs-server
+ # Configuration
+ install -D -m 644 ../exports "$pkgdir/"etc/exports
+ install -D -m 644 ../idmapd.conf "$pkgdir/"etc/idmapd.conf
+ install -D -m 644 ../nfs-common.conf "$pkgdir/"etc/conf.d/nfs-common.conf
+ install -D -m 644 ../nfs-server.conf "$pkgdir/"etc/conf.d/nfs-server.conf
+ install -D -m 644 ../nfs "$pkgdir/"etc/conf.d/nfs
+ install -D -m 644 utils/mount/nfsmount.conf "$pkgdir/"etc/nfsmount.conf
+ # systemd files
+ for i in ${srcdir}/*.{service,mount}; do
+ install -D -m 644 $i "$pkgdir/"usr/lib/systemd/system/$(basename $i)
+ done
+ install -D -m 644 ../nfs-utils.conf "$pkgdir/"usr/lib/modules-load.d/nfs-utils.conf
+ # directories
+ mkdir "$pkgdir/"etc/exports.d
+ mkdir "$pkgdir/"var/lib/nfs/rpc_pipefs
+ mkdir "$pkgdir/"var/lib/nfs/v4recovery
+}
diff --git a/testing/nfs-utils/exports b/testing/nfs-utils/exports
new file mode 100644
index 000000000..8f4aac598
--- /dev/null
+++ b/testing/nfs-utils/exports
@@ -0,0 +1,15 @@
+# /etc/exports
+#
+# List of directories exported to NFS clients. See exports(5).
+# Use exportfs -arv to reread.
+#
+# Example for NFSv2 and NFSv3:
+# /srv/home hostname1(rw,sync) hostname2(ro,sync)
+#
+# Example for NFSv4:
+# /srv/nfs4 hostname1(rw,sync,fsid=0)
+# /srv/nfs4/home hostname1(rw,sync,nohide)
+# Using Kerberos and integrity checking:
+# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt)
+# /srv/nfs4/home gss/krb5i(rw,sync,nohide)
+#
diff --git a/testing/nfs-utils/idmapd.conf b/testing/nfs-utils/idmapd.conf
new file mode 100644
index 000000000..b1b23afe9
--- /dev/null
+++ b/testing/nfs-utils/idmapd.conf
@@ -0,0 +1,14 @@
+[General]
+
+Verbosity = 0
+Pipefs-Directory = /var/lib/nfs/rpc_pipefs
+Domain = localdomain
+
+[Mapping]
+
+Nobody-User = nobody
+Nobody-Group = nobody
+
+[Translation]
+
+Method = nsswitch
diff --git a/testing/nfs-utils/nfs b/testing/nfs-utils/nfs
new file mode 100644
index 000000000..2d33cf3d4
--- /dev/null
+++ b/testing/nfs-utils/nfs
@@ -0,0 +1,40 @@
+#
+# Optinal options passed to rquotad
+RPCRQUOTADOPTS=""
+#
+# Optional arguments passed to in-kernel lockd
+#LOCKDARG=
+# TCP port rpc.lockd should listen on.
+#LOCKD_TCPPORT=32803
+# UDP port rpc.lockd should listen on.
+#LOCKD_UDPPORT=32769
+#
+# Optional arguments passed to rpc.nfsd. See rpc.nfsd(8)
+RPCNFSDARGS=""
+# Number of nfs server processes to be started.
+# The default is 8.
+RPCNFSDCOUNT=8
+# Set V4 grace period in seconds
+#NFSD_V4_GRACE=90
+#
+# Optional arguments passed to rpc.mountd. See rpc.mountd(8)
+RPCMOUNTDOPTS=""
+#
+# Optional arguments passed to rpc.statd. See rpc.statd(8)
+STATDARG=""
+#
+# Optional arguments passed to rpc.idmapd. See rpc.idmapd(8)
+RPCIDMAPDARGS=""
+#
+# Optional arguments passed to rpc.gssd. See rpc.gssd(8)
+RPCGSSDARGS=""
+#
+# Optional arguments passed to rpc.svcgssd. See rpc.svcgssd(8)
+RPCSVCGSSDARGS=""
+#
+# To enable RDMA support on the server by setting this to
+# the port the server should listen on
+#RDMA_PORT=20049
+#
+# Optional arguments passed to blkmapd. See blkmapd(8)
+BLKMAPDARGS=""
diff --git a/testing/nfs-utils/nfs-common b/testing/nfs-utils/nfs-common
new file mode 100644
index 000000000..7b16b4b3c
--- /dev/null
+++ b/testing/nfs-utils/nfs-common
@@ -0,0 +1,315 @@
+#!/bin/bash
+
+daemon_name=nfs-common
+
+NEED_STATD=
+STATD_OPTS=
+NEED_IDMAPD=
+IDMAPD_OPTS=
+NEED_GSSD=
+GSSD_OPTS=
+PIPEFS_MOUNTPOINT=
+PIPEFS_MOUNTOPTS=
+
+# rpc.statd daemon & binary location
+STATD_DAEMON_NAME=rpc.statd
+STATD="/usr/sbin/rpc.statd"
+
+# rpc.idmapd daemon & binary location
+IDMAPD_DAEMON_NAME=rpc.idmapd
+IDMAPD="/usr/sbin/rpc.idmapd"
+
+# rpc.gssd daemon & binary location
+GSSD_DAEMON_NAME=rpc.gssd
+GSSD="/usr/sbin/rpc.gssd"
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/$daemon_name.conf
+
+# Default mountpoint and options for rpc_pipefs filesystem
+[ -z "$PIPEFS_MOUNTPOINT" ] && PIPEFS_MOUNTPOINT="/var/lib/nfs/rpc_pipefs"
+[ -z "$PIPEFS_MOUNTOPTS" ] && PIPEFS_MOUNTOPTS="defaults"
+
+# Parse the fstab file, and determine whether we need idmapd and gssd. (The
+# /etc/conf.d/nfs-common settings, if any, will override our autodetection.)
+AUTO_NEED_IDMAPD=no
+AUTO_NEED_GSSD=no
+
+if [ -f /etc/fstab ]; then
+ exec 9<&0 </etc/fstab
+
+ while read DEV MTPT FSTYPE OPTS REST; do
+ if [ "$FSTYPE" = "nfs4" ]; then
+ AUTO_NEED_IDMAPD=yes
+ fi
+ case "$OPTS" in
+ sec=krb5|*,sec=krb5|sec=krb5,*|*,sec=krb5i,*|sec=krb5i|*,sec=krb5i|sec=krb5i,*|*,sec=krb5i,*|sec=krb5p|*,sec=krb5p|sec=krb5p,*|*,sec=krb5p,*)
+ AUTO_NEED_GSSD=yes
+ ;;
+ esac
+ done
+
+ exec 0<&9 9<&-
+fi
+
+# 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 ] && grep -q '^[[:space:]]*[^#]*/' /etc/exports; then
+ AUTO_NEED_IDMAPD=yes
+fi
+
+case "$NEED_STATD" in
+ yes|no)
+ ;;
+ *)
+ NEED_STATD=yes
+ ;;
+esac
+
+case "$NEED_IDMAPD" in
+ yes|no)
+ ;;
+ *)
+ NEED_IDMAPD=$AUTO_NEED_IDMAPD
+ ;;
+esac
+
+case "$NEED_GSSD" in
+ yes|no)
+ ;;
+ *)
+ NEED_GSSD=$AUTO_NEED_GSSD
+ ;;
+esac
+
+do_modprobe() {
+ if [ -x /sbin/modprobe -a -f /proc/modules ]; then
+ modprobe -q "$1" || true
+ fi
+}
+
+do_mount() {
+ if ! grep -E "$1\$" /proc/filesystems &> /dev/null ; then
+ return 1
+ fi
+
+ if grep -vw "$1" /proc/mounts &> /dev/null ; then
+ if ! mountpoint -q "$2" ; then
+ mount -t "$1" "$1" "$2" -o "$3"
+ return
+ fi
+ fi
+ return 0
+}
+
+do_umount() {
+ if mountpoint -q "$1" ; then
+ umount "$1"
+ fi
+ return 0
+}
+
+get_pid() {
+ pidof -o %PPID "$1"
+}
+
+case "$1" in
+ start)
+ ck_daemon rpcbind && { echo -n "Start rpcbind first." >&2; stat_die; }
+ rc=0
+ if [ "$NEED_STATD" = yes ]; then
+ stat_busy "Starting $STATD_DAEMON_NAME daemon"
+ PID=$(get_pid $STATD)
+ if [ -z "$PID" ]; then
+ [ -f /var/run/$STATD_DAEMON_NAME.pid ] && rm -f /var/run/$STATD_DAEMON_NAME.pid
+ # RUN
+ $STATD $STATD_OPTS
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ echo $(get_pid $STATD) > /var/run/$STATD_DAEMON_NAME.pid
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ # Run sm-notify
+ /usr/sbin/sm-notify $SMNOTIFY_OPTS
+ fi
+
+ if [ "$NEED_IDMAPD" = yes ] || [ "$NEED_GSSD" = yes ]; then
+ stat_busy "Mounting pipefs filesystem"
+ do_modprobe sunrpc
+ do_modprobe nfs
+ do_modprobe nfsd
+ do_mount rpc_pipefs "$PIPEFS_MOUNTPOINT" "$PIPEFS_MOUNTOPTS"
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ stat_done
+ fi
+
+ if [ "$NEED_IDMAPD" = yes ]; then
+ stat_busy "Starting $IDMAPD_DAEMON_NAME daemon"
+ PID=$(get_pid $IDMAPD)
+ if [ -z "$PID" ]; then
+ [ -f /var/run/$IDMAPD_DAEMON_NAME.pid ] && rm -f /var/run/$IDMAPD_DAEMON_NAME.pid
+ # RUN
+ $IDMAPD $IDMAPD_OPTS
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ echo $(get_pid $IDMAPD) > /var/run/$IDMAPD_DAEMON_NAME.pid
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ fi
+
+ if [ "$NEED_GSSD" = yes ]; then
+ do_modprobe rpcsec_gss_krb5
+ stat_busy "Starting $GSSD_DAEMON_NAME daemon"
+ PID=$(get_pid $GSSD)
+ if [ -z "$PID" ]; then
+ [ -f /var/run/$GSSD_DAEMON_NAME.pid ] && rm -f /var/run/$GSSD_DAEMON_NAME.pid
+ # RUN
+ $GSSD $GSSD_OPTS
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ echo $(get_pid $GSSD) > /var/run/$GSSD_DAEMON_NAME.pid
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ fi
+ fi
+
+ add_daemon $daemon_name
+ ;;
+
+ stop)
+ rc=0
+ if [ "$NEED_IDMAPD" = yes ] || [ "$NEED_GSSD" = yes ]; then
+
+ if [ "$NEED_GSSD" = yes ]; then
+ stat_busy "Stopping $GSSD_DAEMON_NAME daemon"
+ PID=$(get_pid $GSSD)
+ # KILL
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ rm -f /var/run/$GSSD_DAEMON_NAME.pid &> /dev/null
+ stat_done
+ fi
+ fi
+
+ if [ "$NEED_IDMAPD" = yes ]; then
+ stat_busy "Stopping $IDMAPD_DAEMON_NAME daemon"
+ PID=$(get_pid $IDMAPD)
+ # KILL
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ rm -f /var/run/$IDMAPD_DAEMON_NAME.pid &> /dev/null
+ stat_done
+ fi
+ fi
+ do_umount "$PIPEFS_MOUNTPOINT" 2>/dev/null || true
+ fi
+
+ if [ "$NEED_STATD" = yes ]; then
+ stat_busy "Stopping $STATD_DAEMON_NAME daemon"
+ PID=$(get_pid $STATD)
+ # KILL
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ rm -f /var/run/$STATD_DAEMON_NAME.pid &> /dev/null
+ stat_done
+ fi
+ fi
+
+ rm_daemon $daemon_name
+ ;;
+
+ status)
+ stat_busy "Checking $daemon_name status";
+ ck_status $daemon_name
+
+ if [ "$NEED_STATD" = yes ]; then
+ stat_busy "Daemon $STATD_DAEMON_NAME running"
+ PID=$(get_pid $STATD)
+ if [ -z "$PID" ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+ fi
+
+ if [ "$NEED_GSSD" = yes ]; then
+ stat_busy "Daemon $GSSD_DAEMON_NAME running"
+ PID=$(get_pid $GSSD)
+ if [ -z "$PID" ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+ fi
+
+ if [ "$NEED_IDMAPD" = yes ]; then
+ stat_busy "Daemon $IDMAPD_DAEMON_NAME running"
+ PID=$(get_pid $IDMAPD)
+ if [ -z "$PID" ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+ fi
+ echo
+ ;;
+
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|status|restart}"
+esac
+exit 0
+
diff --git a/testing/nfs-utils/nfs-common.conf b/testing/nfs-utils/nfs-common.conf
new file mode 100644
index 000000000..12466b3e5
--- /dev/null
+++ b/testing/nfs-utils/nfs-common.conf
@@ -0,0 +1,40 @@
+# Parameters to be passed to nfs-common (nfs clients & server) init script.
+#
+
+# If you do not set values for the NEED_ options, they will be attempted
+# 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 to pass to rpc.statd.
+# See rpc.statd(8) for more details.
+# N.B. statd normally runs on both client and server, and run-time
+# options should be specified accordingly.
+# STATD_OPTS="-p 32765 -o 32766"
+STATD_OPTS=""
+
+# Options to pass to sm-notify
+# e.g. SMNOTIFY_OPTS="-p 32764"
+SMNOTIFY_OPTS=""
+
+# Do you want to start the idmapd daemon? It is only needed for NFSv4.
+NEED_IDMAPD=""
+
+# Options to pass to rpc.idmapd.
+# See rpc.idmapd(8) for more details.
+IDMAPD_OPTS=""
+
+# Do you want to start the gssd daemon? It is required for Kerberos mounts.
+NEED_GSSD=""
+
+# Options to pass to rpc.gssd.
+# See rpc.gssd(8) for more details.
+GSSD_OPTS=""
+
+# Where to mount rpc_pipefs filesystem; the default is "/var/lib/nfs/rpc_pipefs".
+PIPEFS_MOUNTPOINT=""
+
+# Options used to mount rpc_pipefs filesystem; the default is "defaults".
+PIPEFS_MOUNTOPTS=""
diff --git a/testing/nfs-utils/nfs-server b/testing/nfs-utils/nfs-server
new file mode 100644
index 000000000..6aa609d8c
--- /dev/null
+++ b/testing/nfs-utils/nfs-server
@@ -0,0 +1,299 @@
+#!/bin/bash
+
+daemon_name=nfs-server
+
+NFSD_COUNT=
+NFSD_OPTS=
+NEED_SVCGSSD=
+SVCGSSD_OPTS=
+MOUNTD_OPTS=
+PROCNFSD_MOUNTPOINT=
+PROCNFSD_MOUNTOPTS=
+
+# rpc.nfsd daemon & binary location
+NFSD_PROCESS_NAME=nfsd
+NFSD_DAEMON_NAME=rpc.nfsd
+NFSD="/usr/sbin/rpc.nfsd"
+
+# rpc.svcgssd daemon & binary location
+SVCGSSD_DAEMON_NAME=rpc.svcgssd
+SVCGSSD="/usr/sbin/rpc.svcgssd"
+
+# rpc.idmapd daemon & binary location
+IDMAPD_DAEMON_NAME=rpc.idmapd
+IDMAPD="/usr/sbin/rpc.idmapd"
+
+# rpc.mountd daemon & binary location
+MOUNTD_DAEMON_NAME=rpc.mountd
+MOUNTD="/usr/sbin/rpc.mountd"
+
+# exortfs binary location
+EXPORTFS="/usr/sbin/exportfs"
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/$daemon_name.conf
+
+# Default number of nfsd servers
+[ -z "$NFSD_COUNT" ] && NFSD_COUNT=8
+
+# Default mountpoint and options for nfsd filesystem
+[ -z "$PROCNFSD_MOUNTPOINT" ] && PROCNFSD_MOUNTPOINT="/proc/fs/nfsd"
+[ -z "$PROCNFSD_MOUNTOPTS" ] && PROCNFSD_MOUNTOPTS="rw,nodev,noexec,nosuid"
+
+case "$NEED_SVCGSSD" in
+ yes|no)
+ ;;
+ *)
+ NEED_SVCGSSD=no
+ ;;
+esac
+
+do_modprobe() {
+ if [ -x /sbin/modprobe -a -f /proc/modules ]; then
+ modprobe -q "$1" || true
+ fi
+}
+
+do_mount() {
+ if ! grep -E "$1\$" /proc/filesystems &> /dev/null ; then
+ return 1
+ fi
+
+ if grep -vw "$1" /proc/mounts &> /dev/null ; then
+ if ! mountpoint -q "$2" ; then
+ mount -t "$1" "$1" "$2" -o "$3"
+ return
+ fi
+ fi
+ return 0
+}
+
+do_umount() {
+ if mountpoint -q "$1" ; then
+ umount "$1"
+ fi
+ return 0
+}
+
+get_pid() {
+ pidof -o %PPID "$1"
+}
+
+case "$1" in
+ start)
+ ck_daemon nfs-common && { echo -n "Start nfs-common first." >&2; stat_die; }
+ rc=0
+ stat_busy "Mounting nfsd filesystem"
+ do_modprobe nfsd
+ do_mount nfsd "$PROCNFSD_MOUNTPOINT" "$PROCNFSD_MOUNTOPTS"
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ stat_done
+ fi
+
+ stat_busy "Exporting all directories"
+ $EXPORTFS -r
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ stat_done
+ fi
+
+ stat_busy "Starting $NFSD_DAEMON_NAME daemon"
+ PID=$(get_pid $NFSD_PROCESS_NAME)
+ if [ -z "$PID" ]; then
+ [ -f /var/run/$NFSD_DAEMON_NAME.pid ] && rm -f /var/run/$NFSD_DAEMON_NAME.pid
+ # RUN
+ $NFSD $NFSD_OPTS $NFSD_COUNT
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ echo $(get_pid $NFSD_PROCESS_NAME) > /var/run/$NFSD_DAEMON_NAME.pid
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+
+ if [ "$NEED_SVCGSSD" = yes ]; then
+ do_modprobe rpcsec_gss_krb5
+ stat_busy "Starting $SVCGSSD_DAEMON_NAME daemon"
+ PID=$(get_pid $SVCGSSD)
+ if [ -z "$PID" ]; then
+ [ -f /var/run/$SVCGSSD_DAEMON_NAME.pid ] && rm -f /var/run/$SVCGSSD_DAEMON_NAME.pid
+ # RUN
+ $SVCGSSD $SVCGSSD_OPTS
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ echo $(get_pid $SVCGSSD) > /var/run/$SVCGSSD_DAEMON_NAME.pid
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ fi
+
+ PID=$(get_pid $IDMAPD)
+ [ ! -z "$PID" ] && kill -SIGHUP $IDMAPD_DAEMON_NAME &> /dev/null
+
+ stat_busy "Starting $MOUNTD_DAEMON_NAME daemon"
+ PID=$(get_pid $MOUNTD)
+ if [ -z "$PID" ]; then
+ [ -f /var/run/$MOUNTD_DAEMON_NAME.pid ] && rm -f /var/run/$MOUNTD_DAEMON_NAME.pid
+ # RUN
+ $MOUNTD $MOUNTD_OPTS
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ echo $(get_pid $MOUNTD) > /var/run/$MOUNTD_DAEMON_NAME.pid
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+
+ add_daemon $daemon_name
+ ;;
+
+ stop)
+ rc=0
+ stat_busy "Stopping $MOUNTD_DAEMON_NAME daemon"
+ PID=$(get_pid $MOUNTD)
+ # KILL
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ rm -f /var/run/$MOUNTD_DAEMON_NAME.pid &> /dev/null
+ stat_done
+ fi
+
+ if [ "$NEED_SVCGSSD" = yes ]; then
+ stat_busy "Stopping $SVCGSSD_DAEMON_NAME daemon"
+ PID=$(get_pid $SVCGSSD)
+ # KILL
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ rm -f /var/run/$SVCGSSD_DAEMON_NAME.pid &> /dev/null
+ stat_done
+ fi
+ fi
+
+ stat_busy "Stopping $NFSD_DAEMON_NAME daemon"
+ PID=$(get_pid $NFSD_PROCESS_NAME)
+ # KILL (SIGINT)
+ [ ! -z "$PID" ] && kill -2 $PID &> /dev/null
+ #
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ sleep 1
+ PID=$(get_pid $NFSD_PROCESS_NAME)
+ # KILL (KILL) - just to be sure
+ [ ! -z "$PID" ] && kill -9 $PID &> /dev/null
+ #
+ rm -f /var/run/$NFSD_DAEMON_NAME.pid &> /dev/null
+ stat_done
+ fi
+
+ stat_busy "Unexporting all directories"
+ $EXPORTFS -au
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ stat_done
+ fi
+
+ # flush everything out of the kernels export table
+ if mountpoint -q "$PROCNFSD_MOUNTPOINT" ; then
+ $EXPORTFS -f
+ fi
+ do_umount "$PROCNFSD_MOUNTPOINT" 2>/dev/null || true
+ rm_daemon $daemon_name
+ ;;
+
+ status)
+ stat_busy "Checking $daemon_name status";
+ ck_status $daemon_name
+
+ stat_busy "Daemon $NFSD_DAEMON_NAME running"
+ PID=$(get_pid $NFSD_PROCESS_NAME)
+ if [ -z "$PID" ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+
+ stat_busy "Daemon $MOUNTD_DAEMON_NAME running"
+ PID=$(get_pid $MOUNTD)
+ if [ -z "$PID" ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+
+ if [ "$NEED_SVCGSSD" = yes ]; then
+ stat_busy "Daemon $SVCGSSD_DAEMON_NAME running"
+ PID=$(get_pid $SVCGSSD)
+ if [ -z "$PID" ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+ fi
+ echo
+ ;;
+
+ reload)
+ rc=0
+ stat_busy "Re-exporting all directories"
+ $EXPORTFS -r
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ exit $rc
+ else
+ stat_done
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|status|reload|restart}"
+esac
+exit 0
diff --git a/testing/nfs-utils/nfs-server.conf b/testing/nfs-utils/nfs-server.conf
new file mode 100644
index 000000000..581e26350
--- /dev/null
+++ b/testing/nfs-utils/nfs-server.conf
@@ -0,0 +1,29 @@
+# Parameters to be passed to nfs-server init script.
+#
+
+# Options to pass to rpc.nfsd.
+# See rpc.nfsd(8) for more details.
+NFSD_OPTS=""
+
+# Number of servers to start up; the default is 8 servers.
+NFSD_COUNT=""
+
+# Where to mount nfsd filesystem; the default is "/proc/fs/nfsd".
+PROCNFSD_MOUNTPOINT=""
+
+# Options used to mount nfsd filesystem; the default is "rw,nodev,noexec,nosuid".
+PROCNFSD_MOUNTOPTS=""
+
+# 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.
+# See rpc.mountd(8) for more details.
+MOUNTD_OPTS=""
+
+# Do you want to start the svcgssd daemon? It is only required for Kerberos
+# exports. Valid alternatives are "yes" and "no"; the default is "no".
+NEED_SVCGSSD=""
+
+# Options to pass to rpc.svcgssd.
+# See rpc.svcgssd(8) for more details.
+SVCGSSD_OPTS=""
diff --git a/testing/nfs-utils/nfs-utils-1.1.4-mtab-sym.patch b/testing/nfs-utils/nfs-utils-1.1.4-mtab-sym.patch
new file mode 100644
index 000000000..c9e60afc7
--- /dev/null
+++ b/testing/nfs-utils/nfs-utils-1.1.4-mtab-sym.patch
@@ -0,0 +1,39 @@
+ripped from Debian
+
+--- nfs-utils-1.1.4/utils/mount/fstab.c
++++ nfs-utils-1.1.4/utils/mount/fstab.c
+@@ -57,7 +57,7 @@ mtab_does_not_exist(void) {
+ return var_mtab_does_not_exist;
+ }
+
+-static int
++int
+ mtab_is_a_symlink(void) {
+ get_mtab_info();
+ return var_mtab_is_a_symlink;
+--- nfs-utils-1.1.4/utils/mount/fstab.h
++++ nfs-utils-1.1.4/utils/mount/fstab.h
+@@ -7,6 +7,7 @@
+ #define _PATH_FSTAB "/etc/fstab"
+ #endif
+
++int mtab_is_a_symlink(void);
+ int mtab_is_writable(void);
+ int mtab_does_not_exist(void);
+ void reset_mtab_info(void);
+--- nfs-utils-1.1.4/utils/mount/mount.c
++++ nfs-utils-1.1.4/utils/mount/mount.c
+@@ -230,6 +230,13 @@ create_mtab (void) {
+ int flags;
+ mntFILE *mfp;
+
++ /* Avoid writing if the mtab is a symlink to /proc/mounts, since
++ that would create a file /proc/mounts in case the proc filesystem
++ is not mounted, and the fchmod below would also fail. */
++ if (mtab_is_a_symlink()) {
++ return EX_SUCCESS;
++ }
++
+ lock_mtab();
+
+ mfp = nfs_setmntent (MOUNTED, "a+");
diff --git a/testing/nfs-utils/nfs-utils-1.1.4-no-exec.patch b/testing/nfs-utils/nfs-utils-1.1.4-no-exec.patch
new file mode 100644
index 000000000..ea50a21d8
--- /dev/null
+++ b/testing/nfs-utils/nfs-utils-1.1.4-no-exec.patch
@@ -0,0 +1,15 @@
+ripped from Debian
+
+--- nfs-utils-1.1.2/utils/mount/mount.c
++++ nfs-utils-1.1.2/utils/mount/mount.c
+@@ -381,10 +381,6 @@
+ mount_error(NULL, mount_point, ENOTDIR);
+ return 1;
+ }
+- if (access(mount_point, X_OK) < 0) {
+- mount_error(NULL, mount_point, errno);
+- return 1;
+- }
+
+ return 0;
+ }
diff --git a/testing/nfs-utils/nfs-utils.conf b/testing/nfs-utils/nfs-utils.conf
new file mode 100644
index 000000000..33c97b838
--- /dev/null
+++ b/testing/nfs-utils/nfs-utils.conf
@@ -0,0 +1 @@
+nfs
diff --git a/testing/nfs-utils/nfs-utils.install b/testing/nfs-utils/nfs-utils.install
new file mode 100644
index 000000000..7dcdf9575
--- /dev/null
+++ b/testing/nfs-utils/nfs-utils.install
@@ -0,0 +1,32 @@
+## arg 1: the new package version
+post_install() {
+cat << 'EOM'
+ ==> PLEASE NOTE:
+ ==> Extended configuration options for NFS (clients & server) are available in
+ ==> /etc/conf.d/nfs-common.conf and in /etc/conf.d/nfs-server.conf
+ ==>
+ ==> Please refer to http://wiki.archlinux.org/index.php/Nfs
+ ==> for further information on NFS; for NFSv4, refer to
+ ==> http://wiki.archlinux.org/index.php/NFSv4
+EOM
+}
+
+## arg 1: the new package version
+## arg 2: the old package version
+post_upgrade() {
+ if [ "$(vercmp $2 1.2.0-2)" -lt 0 ]; then
+cat << 'EOM'
+ ==> IMPORTANT NFS UTILS CHANGES:
+ ==> This is a rather important upgrade, you are going to have to change config files.
+ ==> /etc/rc.conf daemons changes:
+ ==> Change portmap to rpcbind
+ ==> Change nfslock to nfs-common
+ ==> Change nfsd to nfs-server
+ ==>
+ ==> Extended configuration options for NFS (clients & server) are available in:
+ ==> /etc/conf.d/nfs-common
+ ==> /etc/conf.d/nfs-server
+ ==> Please change them to your needs.
+EOM
+ fi
+}
diff --git a/testing/nfs-utils/nfsd.service b/testing/nfs-utils/nfsd.service
new file mode 100644
index 000000000..e5481c3d1
--- /dev/null
+++ b/testing/nfs-utils/nfsd.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=NFS server
+After=rpcbind.service
+Requires=rpcbind.service
+
+[Service]
+Type=oneshot
+EnvironmentFile=/etc/conf.d/nfs-server.conf
+ExecStart=/usr/sbin/rpc.nfsd $NFSD_OPTS $NFSD_COUNT
+ExecStartPost=/usr/sbin/exportfs -a
+ExecStop=/usr/sbin/rpc.nfsd 0
+ExecStopPost=/usr/sbin/exportfs -a -u
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/testing/nfs-utils/proc-fs-nfsd.mount b/testing/nfs-utils/proc-fs-nfsd.mount
new file mode 100644
index 000000000..f8664a8be
--- /dev/null
+++ b/testing/nfs-utils/proc-fs-nfsd.mount
@@ -0,0 +1,8 @@
+[Unit]
+Description=RPC Pipe File System
+DefaultDependencies=no
+
+[Mount]
+What=sunrpc
+Where=/proc/fs/nfsd
+Type=rpc_pipefs
diff --git a/testing/nfs-utils/rpc-gssd.service b/testing/nfs-utils/rpc-gssd.service
new file mode 100644
index 000000000..446864d18
--- /dev/null
+++ b/testing/nfs-utils/rpc-gssd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=RPC GSS-API client-side daemon
+After=rpcbind.service var-lib-nfs-rpc_pipefs.mount
+Requires=rpcbind.service var-lib-nfs-rpc_pipefs.mount
+
+[Service]
+Type=forking
+EnvironmentFile=/etc/conf.d/nfs-common.conf
+ExecStart=/usr/sbin/rpc.gssd $GSSD_OPTS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/testing/nfs-utils/rpc-idmapd.service b/testing/nfs-utils/rpc-idmapd.service
new file mode 100644
index 000000000..72cd26a93
--- /dev/null
+++ b/testing/nfs-utils/rpc-idmapd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=NFSv4 ID-name mapping daemon
+After=var-lib-nfs-rpc_pipefs.mount nfsd.service
+Requires=var-lib-nfs-rpc_pipefs.mount
+
+[Service]
+Type=forking
+EnvironmentFile=/etc/conf.d/nfs-common.conf
+ExecStart=/usr/sbin/rpc.idmapd $IDMAPD_OPTS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/testing/nfs-utils/rpc-mountd.service b/testing/nfs-utils/rpc-mountd.service
new file mode 100644
index 000000000..917e1b444
--- /dev/null
+++ b/testing/nfs-utils/rpc-mountd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=NFSv2/3 Mount Daemon
+After=rpcbind.service nfsd.service
+Requires=rpcbind.service nfsd.service
+
+[Service]
+Type=forking
+EnvironmentFile=/etc/conf.d/nfs-server.conf
+ExecStart=/usr/sbin/rpc.mountd $MOUNTD_OPTS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/testing/nfs-utils/rpc-statd.service b/testing/nfs-utils/rpc-statd.service
new file mode 100644
index 000000000..983b4044f
--- /dev/null
+++ b/testing/nfs-utils/rpc-statd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=NFSv2/3 Network Status Monitor Daemon
+After=rpcbind.service
+Requires=rpcbind.service
+
+[Service]
+Type=forking
+EnvironmentFile=/etc/conf.d/nfs-common.conf
+ExecStart=/usr/sbin/rpc.statd $STATD_OPTS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/testing/nfs-utils/rpc-svcgssd.service b/testing/nfs-utils/rpc-svcgssd.service
new file mode 100644
index 000000000..8152e8338
--- /dev/null
+++ b/testing/nfs-utils/rpc-svcgssd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=RPC GSS-API server-side daemon
+After=rpcbind.service
+Requires=rpcbind.service
+
+[Service]
+Type=forking
+EnvironmentFile=/etc/conf.d/nfs-server.conf
+ExecStart=/usr/sbin/rpc.svcgssd $SVCGSSD_OPTS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/testing/nfs-utils/start-statd.patch b/testing/nfs-utils/start-statd.patch
new file mode 100644
index 000000000..5d73b6e35
--- /dev/null
+++ b/testing/nfs-utils/start-statd.patch
@@ -0,0 +1,22 @@
+--- utils/statd/start-statd 2007-05-11 04:40:57.000000000 +0100
++++ utils/statd/start-statd.new 2007-09-21 17:11:34.000000000 +0100
+@@ -1,9 +1,16 @@
+-#!/bin/bash -p
++#!/bin/sh
++
++# Original script provided by the NFS project
++# Modified for Arch Linux by Tom Killian
++
+ # nfsmount calls this script when mounting a filesystem with locking
+ # enabled, but when statd does not seem to be running (based on
+ # /var/run/rpc.statd.pid).
+ # It should run statd with whatever flags are apropriate for this
+ # site.
+-PATH=/sbin:/usr/sbin
+-exec rpc.statd --no-notify
++
++# source application-specific settings
++[ -f /etc/conf.d/nfs-common.conf ] && . /etc/conf.d/nfs-common.conf
++
++exec /usr/sbin/rpc.statd $STATD_OPTS
+
diff --git a/testing/nfs-utils/var-lib-nfs-rpc_pipefs.mount b/testing/nfs-utils/var-lib-nfs-rpc_pipefs.mount
new file mode 100644
index 000000000..4bd440f24
--- /dev/null
+++ b/testing/nfs-utils/var-lib-nfs-rpc_pipefs.mount
@@ -0,0 +1,7 @@
+[Unit]
+Description=RPC pipe filesystem
+
+[Mount]
+What=rpc_pipefs
+Where=/var/lib/nfs/rpc_pipefs
+Type=rpc_pipefs
diff --git a/testing/samba/PKGBUILD b/testing/samba/PKGBUILD
new file mode 100644
index 000000000..749414a95
--- /dev/null
+++ b/testing/samba/PKGBUILD
@@ -0,0 +1,166 @@
+# $Id: PKGBUILD 157197 2012-04-25 14:01:40Z tpowa $
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+pkgbase=samba
+pkgname=('libwbclient' 'smbclient' 'samba')
+pkgver=3.6.4
+# We use the 'A' to fake out pacman's version comparators. Samba chooses
+# to append 'a','b',etc to their subsequent releases, which pamcan
+# misconstrues as alpha, beta, etc. Bad samba!
+_realver=3.6.4
+pkgrel=2
+arch=(i686 x86_64)
+url="http://www.samba.org"
+license=('GPL3')
+makedepends=('db' 'popt' 'libcups' 'acl' 'libldap' 'libcap' 'krb5' 'pam' 'gamin' 'gnutls>=2.4.1' 'talloc' 'tdb')
+source=(http://us1.samba.org/samba/ftp/stable/${pkgbase}-${_realver}.tar.gz
+ samba samba.logrotate
+ swat.xinetd
+ samba.pam
+ samba.conf.d
+ smbd.service
+ nmbd.service
+ winbindd.service
+ smbd.conf)
+### UNINSTALL dmapi package before building!!!
+
+build() {
+ cd ${srcdir}/${pkgbase}-${_realver}/source3
+ ./configure --prefix=/usr \
+ --libdir=/usr/lib/ \
+ --localstatedir=/var \
+ --with-configdir=/etc/samba \
+ --with-lockdir=/var/cache/samba \
+ --with-piddir=/var/run/samba \
+ --with-fhs \
+ --with-pam \
+ --with-pam_smbpass \
+ --with-pammodulesdir=/lib/security \
+ --with-dnsupdate \
+ --with-automount \
+ --with-quotas \
+ --with-ads \
+ --with-acl-support \
+ --with-libsmbclient \
+ --with-syslog \
+ --enable-external-libtalloc \
+ --disable-dnssd \
+ --disable-avahi \
+ --with-shared-modules=idmap_ad,idmap_adex,idmap_rid,idmap_hash,idmap_tdb2 \
+ --enable-external-libtdb
+ make
+}
+
+package_libwbclient () {
+pkgdesc="Samba winbind client library"
+depends=('glibc')
+ cd ${srcdir}/${pkgbase}-${_realver}/source3
+ mkdir -p ${pkgdir}/usr/lib
+ for i in libwbclient*; do
+ cp -a bin/${i}*.so* ${pkgdir}/usr/lib/
+ done
+}
+
+package_smbclient () {
+pkgdesc="Tools to access a server's filespace and printers via SMB"
+depends=('readline' 'popt' 'libldap' 'cifs-utils' 'libcap' 'krb5' 'db' 'e2fsprogs' 'tdb' 'talloc' 'libwbclient')
+ cd ${srcdir}/${pkgbase}-${_realver}/source3
+ mkdir -p ${pkgdir}/usr/bin ${pkgdir}/usr/lib
+ install -m755 bin/{smbclient,rpcclient,smbspool,smbtree,smbcacls,smbcquotas,smbget,net,nmblookup} ${pkgdir}/usr/bin/
+ for i in libnetapi* libsmbclient*;do
+ cp -a bin/${i}*.so* ${pkgdir}/usr/lib/
+ done
+ install -m755 script/smbtar ${pkgdir}/usr/bin/
+ mkdir -p ${pkgdir}/usr/lib/cups/backend
+ ln -sf /usr/bin/smbspool ${pkgdir}/usr/lib/cups/backend/smb
+ mkdir -p ${pkgdir}/usr/include
+ install -m644 include/libsmbclient.h ${pkgdir}/usr/include/
+ install -m644 lib/netapi/netapi.h ${pkgdir}/usr/include/
+ mkdir -p ${pkgdir}/usr/share/man/man{1,7}
+ for man in rpcclient smbcacls smbclient smbcquotas smbget \
+ smbtree smbtar nmblookup; do
+ install -m644 ../docs/manpages/${man}.1 ${pkgdir}/usr/share/man/man1/
+ done
+ install -m644 ../docs/manpages/libsmbclient.7 ${pkgdir}/usr/share/man/man7/
+}
+
+package_samba () {
+pkgdesc="Tools to access a server's filespace and printers via SMB"
+backup=(etc/logrotate.d/samba
+ etc/pam.d/samba
+ etc/samba/smb.conf
+ etc/xinetd.d/swat
+ etc/conf.d/samba)
+depends=('db' 'popt' 'libcups' 'acl' 'libldap' "smbclient>=$pkgver" 'libcap' 'krb5' 'pam' 'gamin' 'gnutls' 'e2fsprogs' 'tdb' 'talloc')
+ cd ${srcdir}/samba-${_realver}/source3
+ mkdir -p ${pkgdir}/etc/samba/private
+ chmod 700 ${pkgdir}/etc/samba/private
+ make DESTDIR=${pkgdir} install
+ chmod 644 ${pkgdir}/usr/include/*.h
+ rm -rf ${pkgdir}/usr/var
+ rm -rf ${pkgdir}/var/run/samba
+ (cd script; cp installbin.sh i; cat i | sed 's/\/sbin\///' > installbin.sh)
+ install -D -m755 ../../samba ${pkgdir}/etc/rc.d/samba
+ install -D -m644 ../../samba.conf.d ${pkgdir}/etc/conf.d/samba
+ mkdir -p ${pkgdir}/etc/samba
+ cat ../examples/smb.conf.default | \
+ sed 's|log file = .*$|log file = /var/log/samba/log.%m|g' >${pkgdir}/etc/samba/smb.conf.default
+ install -D -m644 ../../samba.logrotate ${pkgdir}/etc/logrotate.d/samba
+ install -D -m644 ../../swat.xinetd ${pkgdir}/etc/xinetd.d/swat
+ install -D -m644 ../../samba.pam ${pkgdir}/etc/pam.d/samba
+ # spool directory
+ install -d -m1777 ${pkgdir}/var/spool/samba
+ sed -i 's|/usr/spool/samba|/var/spool/samba|g' ${pkgdir}/etc/samba/smb.conf.default
+ # fix logrotate
+ sed -i -e 's|log.%m|%m.log|g' ${pkgdir}/etc/samba/smb.conf.default
+ # nsswitch libraries
+ install -D -m755 ${srcdir}/samba-${_realver}/nsswitch/libnss_wins.so ${pkgdir}/lib/libnss_wins.so
+ ln -s libnss_wins.so ${pkgdir}/lib/libnss_wins.so.2
+ install -D -m755 ${srcdir}/samba-${_realver}/nsswitch/libnss_winbind.so ${pkgdir}/lib/libnss_winbind.so
+ ln -s libnss_winbind.so ${pkgdir}/lib/libnss_winbind.so.2
+ # winbind krb5 locator
+ mkdir -p ${pkgdir}/usr/lib/krb5/plugins/libkrb5
+ install -d -m 0755 ${pkgdir}/usr/lib/krb5/plugins/libkrb5
+ install -m 755 bin/winbind_krb5_locator.so ${pkgdir}/usr/lib/krb5/plugins/libkrb5/winbind_krb5_locator.so
+ # remove conflict files of smbclient
+ for man in libsmbclient smbspool \
+ mount.cifs net cifs.upcall; do
+ rm -f ${pkgdir}/usr/share/man/man8/${man}.8
+ done
+ for i in libnetapi* libwbclient* libsmbclient* winbind_krb5*;do
+ rm -f ${pkgdir}/usr/lib/$i
+ done
+ for bin in net \
+ nmblookup rpcclient smbcacls smbclient \
+ smbcquotas smbget smbspool smbtar smbtree; do
+ rm -f ${pkgdir}/usr/bin/$bin
+ done
+ rm -f ${pkgdir}/usr/sbin/cifs.upcall
+ rm -f ${pkgdir}/usr/include/netapi.h
+ for man in rpcclient smbcacls smbclient smbcquotas \
+ smbtree smbtar nmblookup smbget; do
+ rm -f ${pkgdir}/usr/share/man/man1/${man}.1
+ done
+ for man in tdbbackup tdbdump tdbtool; do
+ rm -f ${pkgdir}/usr/share/man/man8/${man}.8
+ done
+ rm -f ${pkgdir}/usr/share/man/man7/libsmbclient.7
+ rm -f ${pkgdir}/usr/include/libsmbclient.h
+ # copy ldap example
+ install -D -m644 ${srcdir}/samba-${_realver}/examples/LDAP/samba.schema ${pkgdir}/usr/share/doc/samba/examples/LDAP/samba.schema
+ # install systemd files
+ for i in smbd nmbd winbindd; do
+ install -D -m644 ${srcdir}/$i.service ${pkgdir}/usr/lib/systemd/system/$i.service
+ done
+ install -D -m644 ${srcdir}/smbd.conf ${pkgdir}/usr/lib/tmpfiles.d/samba.conf
+}
+md5sums=('d8e070e2a3b12f202f347e4427469bc2'
+ 'dfc6f9018c556b9783c7140de183727f'
+ '5697da77590ec092cc8a883bae06093c'
+ 'a4bbfa39fee95bba2e7ad6b535fae7e6'
+ '96f82c38f3f540b53f3e5144900acf17'
+ 'f2f2e348acd1ccb566e95fa8a561b828'
+ '389cc4fa3b459360feaa1b3d93274693'
+ 'ea6a1251be979cb30c6098a28b270d2d'
+ '455f106ce7a4f983975b3a686eaa85e5'
+ '6956c4f9989bec8f313de7d9343b6ba1')
diff --git a/testing/samba/nmbd.service b/testing/samba/nmbd.service
new file mode 100644
index 000000000..6e22ef2fb
--- /dev/null
+++ b/testing/samba/nmbd.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Samba NetBIOS name server
+
+[Service]
+ExecStart=/usr/sbin/nmbd -F
+
+[Install]
+WantedBy=multi-user.target
diff --git a/testing/samba/samba b/testing/samba/samba
new file mode 100755
index 000000000..2a04bfec4
--- /dev/null
+++ b/testing/samba/samba
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+[ -f /etc/conf.d/samba ] && . /etc/conf.d/samba
+
+[ -z "$SAMBA_DAEMONS" ] && SAMBA_DAEMONS=(smbd nmbd)
+
+case "$1" in
+ start)
+ rc=0
+ stat_busy "Starting Samba Server"
+ if [ ! -x /var/run/samba ] ; then
+ install -m755 -d /var/run/samba
+ fi
+ if [ ! -x /var/log/samba ] ; then
+ install -m755 -d /var/log/samba
+ fi
+ for d in ${SAMBA_DAEMONS[@]}; do
+ PID=`pidof -o %PPID /usr/sbin/$d`
+ [ -z "$PID" ] && /usr/sbin/$d -D
+ rc=$(($rc+$?))
+ done
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon samba
+ stat_done
+ fi
+ ;;
+ stop)
+ rc=0
+ stat_busy "Stopping Samba Server"
+ for d in ${SAMBA_DAEMONS[@]}; do
+ PID=`pidof -o %PPID /usr/sbin/$d`
+ [ -z "$PID" ] || kill $PID &> /dev/null
+ rc=$(($rc+$?))
+ done
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ else
+ rm /var/run/samba/smbd.pid &>/dev/null
+ rm /var/run/samba/nmbd.pid &>/dev/null
+ rm /var/run/samba/winbindd.pid &>/dev/null
+ rm_daemon samba
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/testing/samba/samba.conf.d b/testing/samba/samba.conf.d
new file mode 100644
index 000000000..8721f956a
--- /dev/null
+++ b/testing/samba/samba.conf.d
@@ -0,0 +1,7 @@
+#
+# Configuration for the samba init script
+#
+
+# space separated list of daemons to launch
+SAMBA_DAEMONS=(smbd nmbd)
+#SAMBA_DAEMONS=(smbd nmbd winbindd)
diff --git a/testing/samba/samba.logrotate b/testing/samba/samba.logrotate
new file mode 100644
index 000000000..581f4c33b
--- /dev/null
+++ b/testing/samba/samba.logrotate
@@ -0,0 +1,9 @@
+/var/log/samba/log.smbd /var/log/samba/log.nmbd /var/log/samba/*.log {
+ notifempty
+ missingok
+ sharedscripts
+ copytruncate
+ postrotate
+ /bin/kill -HUP `cat /var/run/samba/*.pid 2>/dev/null` 2>/dev/null || true
+ endscript
+}
diff --git a/testing/samba/samba.pam b/testing/samba/samba.pam
new file mode 100644
index 000000000..53724d1f8
--- /dev/null
+++ b/testing/samba/samba.pam
@@ -0,0 +1,3 @@
+auth required pam_unix.so
+account required pam_unix.so
+session required pam_unix.so
diff --git a/testing/samba/smbd.conf b/testing/samba/smbd.conf
new file mode 100644
index 000000000..b745bb85b
--- /dev/null
+++ b/testing/samba/smbd.conf
@@ -0,0 +1 @@
+D /var/run/samba 0755 root root -
diff --git a/testing/samba/smbd.service b/testing/samba/smbd.service
new file mode 100644
index 000000000..beb9bfad7
--- /dev/null
+++ b/testing/samba/smbd.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Samba SMB/CIFS server
+
+[Service]
+ExecStart=/usr/sbin/smbd -F
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/testing/samba/swat.xinetd b/testing/samba/swat.xinetd
new file mode 100644
index 000000000..2e62a82b2
--- /dev/null
+++ b/testing/samba/swat.xinetd
@@ -0,0 +1,10 @@
+service swat
+{
+ socket_type = stream
+ wait = no
+ user = root
+ server = /usr/sbin/swat
+ log_on_success += HOST DURATION
+ log_on_failure += HOST
+ disable = yes
+}
diff --git a/testing/samba/winbindd.service b/testing/samba/winbindd.service
new file mode 100644
index 000000000..509c89628
--- /dev/null
+++ b/testing/samba/winbindd.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Samba Winbind daemon
+
+[Service]
+ExecStart=/usr/sbin/winbindd -F
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target