summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@endefensadelsl.org>2014-06-27 03:56:37 +0000
committerNicolás Reynolds <fauno@endefensadelsl.org>2014-06-27 03:56:37 +0000
commit2676c8b3a08c1af42cabaa11ac68985ef635eca3 (patch)
treee04aef3931197d9020ca26e75c3f8f62e666041c /core
parent76b667b6360f6f7e97f13392cf156f197dc4017b (diff)
Fri Jun 27 03:52:25 UTC 2014
Diffstat (limited to 'core')
-rw-r--r--core/nfs-utils/PKGBUILD58
-rw-r--r--core/nfs-utils/blkmapd.service12
-rw-r--r--core/nfs-utils/nfs-client.target8
-rw-r--r--core/nfs-utils/nfs-common.conf20
-rw-r--r--core/nfs-utils/nfs-server.conf15
-rw-r--r--core/nfs-utils/nfs-server.target10
-rw-r--r--core/nfs-utils/nfs-utils-1.1.4-no-exec.patch15
-rw-r--r--core/nfs-utils/nfs-utils-1.3.1-rc2.patch674
-rw-r--r--core/nfs-utils/nfs-utils.install14
-rw-r--r--core/nfs-utils/nfs-utils_env.sh20
-rw-r--r--core/nfs-utils/nfsd.service20
-rw-r--r--core/nfs-utils/proc-fs-nfsd.mount8
-rw-r--r--core/nfs-utils/rpc-gssd.service15
-rw-r--r--core/nfs-utils/rpc-idmapd.service15
-rw-r--r--core/nfs-utils/rpc-mountd.service15
-rw-r--r--core/nfs-utils/rpc-statd.service16
-rw-r--r--core/nfs-utils/rpc-svcgssd.service15
-rw-r--r--core/nfs-utils/start-statd.patch10
-rw-r--r--core/nfs-utils/var-lib-nfs-rpc_pipefs.mount7
-rw-r--r--core/rpcbind/PKGBUILD28
-rw-r--r--core/rpcbind/rpcbind.conf3
-rw-r--r--core/rpcbind/rpcbind.service12
-rw-r--r--core/rpcbind/rpcbind.socket8
23 files changed, 761 insertions, 257 deletions
diff --git a/core/nfs-utils/PKGBUILD b/core/nfs-utils/PKGBUILD
index 2aeaf23f8..8825d2c38 100644
--- a/core/nfs-utils/PKGBUILD
+++ b/core/nfs-utils/PKGBUILD
@@ -1,4 +1,4 @@
-# $Id: PKGBUILD 203559 2014-01-13 16:35:26Z tpowa $
+# $Id: PKGBUILD 215488 2014-06-26 19:15:59Z tpowa $
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: John Proctor <jproctor@prium.net>
# Contributor: dibblethewrecker <dibblethewrecker.at.jiwe.org>
@@ -6,8 +6,8 @@
# Contributor: Marco Lima <cipparello gmail com>
pkgname=nfs-utils
-pkgver=1.2.9
-pkgrel=5
+pkgver=1.3.0
+pkgrel=2
pkgdesc="Support programs for Network File Systems"
arch=('i686' 'x86_64')
url='http://nfs.sourceforge.net'
@@ -21,51 +21,29 @@ source=(http://downloads.sourceforge.net/project/nfs/${pkgname}/${pkgver}/${pkgn
exports
idmapd.conf
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-client.target
- nfs-server.target
- blkmapd.service
nfs-utils.conf
id_resolver.conf
- start-statd.patch)
+ nfs-utils_env.sh
+ nfs-utils-1.3.1-rc2.patch)
install=nfs-utils.install
optdepends=('sqlite: for nfsdcltrack usage')
-md5sums=('18869d16db3f49c053f8c68eba3fe2e0'
- 'f73f197a16b02c3e248488ec35c4cf43'
- '9cef69bc686cc5dcac23fbb51450747d'
+md5sums=('3ac3726eda563946d1f44ac3e5b61d56'
+ '21510b0b30e71c8d6679c7c23f3b78eb'
+ 'c1fe8dd9581c1df788d8965f4f1479f3'
'e6ad3c7a59c7e4c24965a0e7da35026c'
'eb4f4027fab6fc1201f1ca04f5954c76'
'7674106eaaa4c149bccd4f05fe3604e9'
- '4f4827dfc93008dfadd0a530ad0872b2'
- 'b9329c9d4a6b4a72ab2a04aac9229171'
- '656ac433c4443eba6b47744a53a3c7d9'
- '295ec0c9c049e146992561650fec9d52'
- '6ff4f297df4e90440b8bdbc6b1a78480'
- '20d5b8120d1049b27dd44dc4c57f667d'
- '01a1dd533382630ccecc9b882c47aa2f'
- 'f48da2fb07b1d5f016d63c16b0979ebb'
- '972eb80ff8c94c647b977a8a3cdd985f'
- 'a13e9f388cd939d68fa6ada205eb4e25'
- '1ee3eea917131f04bb08f2f858be7724'
- 'f513ab0eae74918df08f329b0c6a9b6f'
'8ac484023d786766d287ccbe878ae4ba'
'a43aabf0b8d02406b1babc3a206d952a'
- 'f8bb29c2ca1ce178e6371091a3e1090d')
+ 'c6c9c32f153dfa6c0477ea6b99354288'
+ '92423a1e833ba90fdc446aa2296ac7f0')
prepare() {
cd $srcdir/${pkgname}-${pkgver}
patch -Np1 -i ../nfs-utils-1.1.4-mtab-sym.patch
- # fix /usr/bin in start-statd shell script
- patch -Np1 -i ../start-statd.patch
- #patch -Np1 -i ../nfs-utils-1.1.4-no-exec.patch
+ # fix segfaults, from fedora git
+ patch -Np1 -i ../nfs-utils-1.3.1-rc2.patch
+ ./autogen.sh
}
build() {
@@ -79,6 +57,8 @@ build() {
sed -i -e 's#sbindir = /sbin#sbindir = /usr/bin#g' utils/mount/Makefile
# move osd_login to /usr/bin
sed -i -e 's#sbindir = /sbin#sbindir = /usr/bin#g' utils/osd_login/Makefile
+ # move nfsdcltrack to /usr/bin
+ sed -i -e 's#sbindir = /sbin#sbindir = /usr/bin#g' utils/nfsdcltrack/Makefile
make
}
@@ -88,17 +68,19 @@ package() {
make DESTDIR="$pkgdir" install
sed -i '1s/python$/python2/' "$pkgdir"/usr/bin/{nfsiostat,mountstats}
install -D -m 644 utils/mount/nfsmount.conf "$pkgdir"/etc/nfsmount.conf
+
+ for i in systemd/{*.service,*.mount,*.target}; do
+ install -D -m 644 $i "$pkgdir"/usr/lib/systemd/system/$(basename $i)
+ done
cd ..
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 755 nfs-utils_env.sh "$pkgdir"/usr/lib/systemd/scripts/nfs-utils_env.sh
install -D -m 644 exports "$pkgdir"/etc/exports
install -D -m 644 idmapd.conf "$pkgdir"/etc/idmapd.conf
install -D -m 644 id_resolver.conf "$pkgdir"/etc/request-key.d/id_resolver.conf
install -D -m 644 nfs-utils.conf "$pkgdir"/usr/lib/modules-load.d/nfs-utils.conf
- for i in *.service *.mount *.target; do
- install -D -m 644 $i "$pkgdir"/usr/lib/systemd/system/$i
- done
mkdir "$pkgdir"/etc/exports.d
mkdir -m 555 "$pkgdir"/var/lib/nfs/rpc_pipefs
mkdir "$pkgdir"/var/lib/nfs/v4recovery
diff --git a/core/nfs-utils/blkmapd.service b/core/nfs-utils/blkmapd.service
deleted file mode 100644
index 04711d09c..000000000
--- a/core/nfs-utils/blkmapd.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=pNFS Block Layout Client Mapping Daemon
-Documentation=man:blkmapd(8)
-After=var-lib-nfs-rpc_pipefs.mount nfsd.service
-Requires=var-lib-nfs-rpc_pipefs.mount
-
-[Service]
-Type=forking
-ExecStart=/usr/bin/blkmapd
-
-[Install]
-WantedBy=multi-user.target
diff --git a/core/nfs-utils/nfs-client.target b/core/nfs-utils/nfs-client.target
deleted file mode 100644
index 1bec662ab..000000000
--- a/core/nfs-utils/nfs-client.target
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=NFS Client Daemons
-Before=remote-fs-pre.target
-Wants=rpc-statd.service
-Wants=rpc-gssd.service
-
-[Install]
-WantedBy=multi-user.target
diff --git a/core/nfs-utils/nfs-common.conf b/core/nfs-utils/nfs-common.conf
index 12466b3e5..ae1130c02 100644
--- a/core/nfs-utils/nfs-common.conf
+++ b/core/nfs-utils/nfs-common.conf
@@ -1,13 +1,6 @@
-# Parameters to be passed to nfs-common (nfs clients & server) init script.
+# Parameters to be passed to nfs systemd services (nfs clients & server).
#
-# 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
@@ -19,22 +12,11 @@ STATD_OPTS=""
# 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/core/nfs-utils/nfs-server.conf b/core/nfs-utils/nfs-server.conf
index 581e26350..95b676eb5 100644
--- a/core/nfs-utils/nfs-server.conf
+++ b/core/nfs-utils/nfs-server.conf
@@ -1,29 +1,16 @@
-# Parameters to be passed to nfs-server init script.
+# Parameters to be passed to nfs systemd server services
#
# 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/core/nfs-utils/nfs-server.target b/core/nfs-utils/nfs-server.target
deleted file mode 100644
index 52f0f04a4..000000000
--- a/core/nfs-utils/nfs-server.target
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=NFS File Server Daemons
-Wants=rpc-mountd.service
-Wants=rpc-idmapd.service
-Wants=rpc-rquotad.service
-Wants=rpc-statd.service
-Wants=rpc-svcgssd.service
-
-[Install]
-WantedBy=multi-user.target
diff --git a/core/nfs-utils/nfs-utils-1.1.4-no-exec.patch b/core/nfs-utils/nfs-utils-1.1.4-no-exec.patch
deleted file mode 100644
index ea50a21d8..000000000
--- a/core/nfs-utils/nfs-utils-1.1.4-no-exec.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-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/core/nfs-utils/nfs-utils-1.3.1-rc2.patch b/core/nfs-utils/nfs-utils-1.3.1-rc2.patch
new file mode 100644
index 000000000..d883ff939
--- /dev/null
+++ b/core/nfs-utils/nfs-utils-1.3.1-rc2.patch
@@ -0,0 +1,674 @@
+diff --git a/support/export/client.c b/support/export/client.c
+index dbf47b9..f85e11c 100644
+--- a/support/export/client.c
++++ b/support/export/client.c
+@@ -482,8 +482,12 @@ add_name(char *old, const char *add)
+ else
+ cp = cp + strlen(cp);
+ }
+- strncpy(new, old, cp-old);
+- new[cp-old] = 0;
++ if (old) {
++ strncpy(new, old, cp-old);
++ new[cp-old] = 0;
++ } else {
++ new[0] = 0;
++ }
+ if (cp != old && !*cp)
+ strcat(new, ",");
+ strcat(new, add);
+diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
+index 341cdbf..b324cd8 100644
+--- a/tools/nfs-iostat/nfs-iostat.py
++++ b/tools/nfs-iostat/nfs-iostat.py
+@@ -243,27 +243,15 @@ class DeviceData:
+ """Print attribute cache efficiency stats
+ """
+ nfs_stats = self.__nfs_data
+- getattr_stats = self.__rpc_data['GETATTR']
+-
+- if nfs_stats['inoderevalidates'] != 0:
+- getattr_ops = float(getattr_stats[1])
+- opens = float(nfs_stats['vfsopen'])
+- revalidates = float(nfs_stats['inoderevalidates']) - opens
+- if revalidates != 0:
+- ratio = ((revalidates - getattr_ops) * 100) / revalidates
+- else:
+- ratio = 0.0
+-
+- data_invalidates = float(nfs_stats['datainvalidates'])
+- attr_invalidates = float(nfs_stats['attrinvalidates'])
+
+- print()
+- print('%d inode revalidations, hitting in cache %4.2f%% of the time' % \
+- (revalidates, ratio))
+- print('%d open operations (mandatory GETATTR requests)' % opens)
+- if getattr_ops != 0:
+- print('%4.2f%% of GETATTRs resulted in data cache invalidations' % \
+- ((data_invalidates * 100) / getattr_ops))
++ print()
++ print('%d VFS opens' % (nfs_stats['vfsopen']))
++ print('%d inoderevalidates (forced GETATTRs)' % \
++ (nfs_stats['inoderevalidates']))
++ print('%d page cache invalidations' % \
++ (nfs_stats['datainvalidates']))
++ print('%d attribute cache invalidations' % \
++ (nfs_stats['attrinvalidates']))
+
+ def __print_dir_cache_stats(self, sample_time):
+ """Print directory stats
+@@ -353,15 +341,21 @@ class DeviceData:
+ exe_per_op = 0.0
+
+ op += ':'
+- print('%s' % op.lower().ljust(15), end='')
+- print(' ops/s\t\t kB/s\t\t kB/op\t\tretrans\t\tavg RTT (ms)\tavg exe (ms)')
+-
+- print('\t\t%7.3f' % (ops / sample_time), end='')
+- print('\t%7.3f' % (kilobytes / sample_time), end='')
+- print('\t%7.3f' % kb_per_op, end='')
+- print(' %7d (%3.1f%%)' % (retrans, retrans_percent), end='')
+- print('\t%7.3f' % rtt_per_op, end='')
+- print('\t%7.3f' % exe_per_op)
++ print(format(op.lower(), '<16s'), end='')
++ print(format('ops/s', '>8s'), end='')
++ print(format('kB/s', '>16s'), end='')
++ print(format('kB/op', '>16s'), end='')
++ print(format('retrans', '>16s'), end='')
++ print(format('avg RTT (ms)', '>16s'), end='')
++ print(format('avg exe (ms)', '>16s'))
++
++ print(format((ops / sample_time), '>24.3f'), end='')
++ print(format((kilobytes / sample_time), '>16.3f'), end='')
++ print(format(kb_per_op, '>16.3f'), end='')
++ retransmits = '{0:>10.0f} ({1:>3.1f}%)'.format(retrans, retrans_percent).strip()
++ print(format(retransmits, '>16'), end='')
++ print(format(rtt_per_op, '>16.3f'), end='')
++ print(format(exe_per_op, '>16.3f'))
+
+ def ops(self, sample_time):
+ sends = float(self.__rpc_data['rpcsends'])
+@@ -391,9 +385,10 @@ class DeviceData:
+ (self.__nfs_data['export'], self.__nfs_data['mountpoint']))
+ print()
+
+- print(' op/s\t\trpc bklog')
+- print('%7.2f' % (sends / sample_time), end='')
+- print('\t%7.2f' % backlog)
++ print(format('ops/s', '>16') + format('rpc bklog', '>16'))
++ print(format((sends / sample_time), '>16.3f'), end='')
++ print(format(backlog, '>16.3f'))
++ print()
+
+ if which == 0:
+ self.__print_rpc_op_stats('READ', sample_time)
+diff --git a/utils/gssd/Makefile.am b/utils/gssd/Makefile.am
+index a9a3e42..af59791 100644
+--- a/utils/gssd/Makefile.am
++++ b/utils/gssd/Makefile.am
+@@ -18,11 +18,13 @@ COMMON_SRCS = \
+ context_lucid.c \
+ gss_util.c \
+ gss_oids.c \
++ gss_names.c \
+ err_util.c \
+ \
+ context.h \
+ err_util.h \
+ gss_oids.h \
++ gss_names.h \
+ gss_util.h
+
+ gssd_SOURCES = \
+diff --git a/utils/gssd/gss_names.c b/utils/gssd/gss_names.c
+new file mode 100644
+index 0000000..047069d
+--- /dev/null
++++ b/utils/gssd/gss_names.c
+@@ -0,0 +1,138 @@
++/*
++ Copyright (c) 2000 The Regents of the University of Michigan.
++ All rights reserved.
++
++ Copyright (c) 2002 Bruce Fields <bfields@UMICH.EDU>
++
++ Redistribution and use in source and binary forms, with or without
++ modification, are permitted provided that the following conditions
++ are met:
++
++ 1. Redistributions of source code must retain the above copyright
++ notice, this list of conditions and the following disclaimer.
++ 2. Redistributions in binary form must reproduce the above copyright
++ notice, this list of conditions and the following disclaimer in the
++ documentation and/or other materials provided with the distribution.
++ 3. Neither the name of the University nor the names of its
++ contributors may be used to endorse or promote products derived
++ from this software without specific prior written permission.
++
++ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
++ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++ DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
++ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++*/
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif /* HAVE_CONFIG_H */
++
++#include <sys/param.h>
++#include <sys/stat.h>
++#include <rpc/rpc.h>
++
++#include <pwd.h>
++#include <stdio.h>
++#include <unistd.h>
++#include <ctype.h>
++#include <string.h>
++#include <fcntl.h>
++#include <errno.h>
++#include <nfsidmap.h>
++#include <nfslib.h>
++#include <time.h>
++
++#include "svcgssd.h"
++#include "gss_util.h"
++#include "err_util.h"
++#include "context.h"
++#include "misc.h"
++#include "gss_oids.h"
++#include "svcgssd_krb5.h"
++
++static int
++get_krb5_hostbased_name(gss_buffer_desc *name, char **hostbased_name)
++{
++ char *p, *sname = NULL;
++ if (strchr(name->value, '@') && strchr(name->value, '/')) {
++ if ((sname = calloc(name->length, 1)) == NULL) {
++ printerr(0, "ERROR: get_krb5_hostbased_name failed "
++ "to allocate %d bytes\n", name->length);
++ return -1;
++ }
++ /* read in name and instance and replace '/' with '@' */
++ sscanf(name->value, "%[^@]", sname);
++ p = strrchr(sname, '/');
++ if (p == NULL) { /* The '@' preceeded the '/' */
++ free(sname);
++ return -1;
++ }
++ *p = '@';
++ }
++ *hostbased_name = sname;
++ return 0;
++}
++
++int
++get_hostbased_client_name(gss_name_t client_name, gss_OID mech,
++ char **hostbased_name)
++{
++ u_int32_t maj_stat, min_stat;
++ gss_buffer_desc name;
++ gss_OID name_type = GSS_C_NO_OID;
++ char *cname;
++ int res = -1;
++
++ *hostbased_name = NULL; /* preset in case we fail */
++
++ /* Get the client's gss authenticated name */
++ maj_stat = gss_display_name(&min_stat, client_name, &name, &name_type);
++ if (maj_stat != GSS_S_COMPLETE) {
++ pgsserr("get_hostbased_client_name: gss_display_name",
++ maj_stat, min_stat, mech);
++ goto out_err;
++ }
++ if (name.length >= 0xffff) { /* don't overflow */
++ printerr(0, "ERROR: get_hostbased_client_name: "
++ "received gss_name is too long (%d bytes)\n",
++ name.length);
++ goto out_rel_buf;
++ }
++
++ /* For Kerberos, transform the NT_KRB5_PRINCIPAL name to
++ * an NT_HOSTBASED_SERVICE name */
++ if (g_OID_equal(&krb5oid, mech)) {
++ if (get_krb5_hostbased_name(&name, &cname) == 0)
++ *hostbased_name = cname;
++ } else {
++ printerr(1, "WARNING: unknown/unsupport mech OID\n");
++ }
++
++ res = 0;
++out_rel_buf:
++ gss_release_buffer(&min_stat, &name);
++out_err:
++ return res;
++}
++
++void
++get_hostbased_client_buffer(gss_name_t client_name, gss_OID mech,
++ gss_buffer_t buf)
++{
++ char *hname;
++
++ if (!get_hostbased_client_name(client_name, mech, &hname)) {
++ buf->length = strlen(hname) + 1;
++ buf->value = hname;
++ } else {
++ buf->length = 0;
++ buf->value = NULL;
++ }
++}
+diff --git a/utils/gssd/gss_names.h b/utils/gssd/gss_names.h
+new file mode 100644
+index 0000000..ce182f7
+--- /dev/null
++++ b/utils/gssd/gss_names.h
+@@ -0,0 +1,36 @@
++/*
++ Copyright (c) 2000 The Regents of the University of Michigan.
++ All rights reserved.
++
++ Copyright (c) 2002 Bruce Fields <bfields@UMICH.EDU>
++
++ Redistribution and use in source and binary forms, with or without
++ modification, are permitted provided that the following conditions
++ are met:
++
++ 1. Redistributions of source code must retain the above copyright
++ notice, this list of conditions and the following disclaimer.
++ 2. Redistributions in binary form must reproduce the above copyright
++ notice, this list of conditions and the following disclaimer in the
++ documentation and/or other materials provided with the distribution.
++ 3. Neither the name of the University nor the names of its
++ contributors may be used to endorse or promote products derived
++ from this software without specific prior written permission.
++
++ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
++ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++ DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
++ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++*/
++
++extern int get_hostbased_client_name(gss_name_t client_name, gss_OID mech,
++ char **hostbased_name);
++extern void get_hostbased_client_buffer(gss_name_t client_name,
++ gss_OID mech, gss_buffer_t buf);
+diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c
+index 33cfeb2..40ff188 100644
+--- a/utils/gssd/gssd_proc.c
++++ b/utils/gssd/gssd_proc.c
+@@ -77,6 +77,7 @@
+ #include "context.h"
+ #include "nfsrpc.h"
+ #include "nfslib.h"
++#include "gss_names.h"
+
+ /*
+ * pollarray:
+@@ -681,19 +682,25 @@ parse_enctypes(char *enctypes)
+ return 0;
+ }
+
+-static int
++static void
+ do_downcall(int k5_fd, uid_t uid, struct authgss_private_data *pd,
+- gss_buffer_desc *context_token, OM_uint32 lifetime_rec)
++ gss_buffer_desc *context_token, OM_uint32 lifetime_rec,
++ gss_buffer_desc *acceptor)
+ {
+ char *buf = NULL, *p = NULL, *end = NULL;
+ unsigned int timeout = context_timeout;
+ unsigned int buf_size = 0;
+
+- printerr(1, "doing downcall lifetime_rec %u\n", lifetime_rec);
++ printerr(1, "doing downcall: lifetime_rec=%u acceptor=%.*s\n",
++ lifetime_rec, acceptor->length, acceptor->value);
+ buf_size = sizeof(uid) + sizeof(timeout) + sizeof(pd->pd_seq_win) +
+ sizeof(pd->pd_ctx_hndl.length) + pd->pd_ctx_hndl.length +
+- sizeof(context_token->length) + context_token->length;
++ sizeof(context_token->length) + context_token->length +
++ sizeof(acceptor->length) + acceptor->length;
+ p = buf = malloc(buf_size);
++ if (!buf)
++ goto out_err;
++
+ end = buf + buf_size;
+
+ /* context_timeout set by -t option overrides context lifetime */
+@@ -704,14 +711,15 @@ do_downcall(int k5_fd, uid_t uid, struct authgss_private_data *pd,
+ if (WRITE_BYTES(&p, end, pd->pd_seq_win)) goto out_err;
+ if (write_buffer(&p, end, &pd->pd_ctx_hndl)) goto out_err;
+ if (write_buffer(&p, end, context_token)) goto out_err;
++ if (write_buffer(&p, end, acceptor)) goto out_err;
+
+ if (write(k5_fd, buf, p - buf) < p - buf) goto out_err;
+- if (buf) free(buf);
+- return 0;
++ free(buf);
++ return;
+ out_err:
+- if (buf) free(buf);
++ free(buf);
+ printerr(1, "Failed to write downcall!\n");
+- return -1;
++ return;
+ }
+
+ static int
+@@ -1031,6 +1039,9 @@ process_krb5_upcall(struct clnt_info *clp, uid_t uid, int fd, char *tgtname,
+ gss_cred_id_t gss_cred;
+ OM_uint32 maj_stat, min_stat, lifetime_rec;
+ pid_t pid;
++ gss_name_t gacceptor = GSS_C_NO_NAME;
++ gss_OID mech;
++ gss_buffer_desc acceptor = {0};
+
+ pid = fork();
+ switch(pid) {
+@@ -1171,15 +1182,24 @@ process_krb5_upcall(struct clnt_info *clp, uid_t uid, int fd, char *tgtname,
+ goto out_return_error;
+ }
+
+- /* Grab the context lifetime to pass to the kernel. lifetime_rec
+- * is set to zero on error */
+- maj_stat = gss_inquire_context(&min_stat, pd.pd_ctx, NULL, NULL,
+- &lifetime_rec, NULL, NULL, NULL, NULL);
++ /* Grab the context lifetime and acceptor name out of the ctx. */
++ maj_stat = gss_inquire_context(&min_stat, pd.pd_ctx, NULL, &gacceptor,
++ &lifetime_rec, &mech, NULL, NULL, NULL);
+
+- if (maj_stat)
+- printerr(1, "WARNING: Failed to inquire context for lifetme "
+- "maj_stat %u\n", maj_stat);
++ if (maj_stat != GSS_S_COMPLETE) {
++ printerr(1, "WARNING: Failed to inquire context "
++ "maj_stat (0x%x)\n", maj_stat);
++ lifetime_rec = 0;
++ } else {
++ get_hostbased_client_buffer(gacceptor, mech, &acceptor);
++ gss_release_name(&min_stat, &gacceptor);
++ }
+
++ /*
++ * The serialization can mean turning pd.pd_ctx into a lucid context. If
++ * that happens then the pd.pd_ctx will be unusable, so we must never
++ * try to use it after this point.
++ */
+ if (serialize_context_for_kernel(&pd.pd_ctx, &token, &krb5oid, NULL)) {
+ printerr(0, "WARNING: Failed to serialize krb5 context for "
+ "user with uid %d for server %s\n",
+@@ -1187,9 +1207,10 @@ process_krb5_upcall(struct clnt_info *clp, uid_t uid, int fd, char *tgtname,
+ goto out_return_error;
+ }
+
+- do_downcall(fd, uid, &pd, &token, lifetime_rec);
++ do_downcall(fd, uid, &pd, &token, lifetime_rec, &acceptor);
+
+ out:
++ gss_release_buffer(&min_stat, &acceptor);
+ if (token.value)
+ free(token.value);
+ #ifdef HAVE_AUTHGSS_FREE_PRIVATE_DATA
+diff --git a/utils/gssd/svcgssd_proc.c b/utils/gssd/svcgssd_proc.c
+index 3757d51..5bdb438 100644
+--- a/utils/gssd/svcgssd_proc.c
++++ b/utils/gssd/svcgssd_proc.c
+@@ -59,6 +59,7 @@
+ #include "misc.h"
+ #include "gss_oids.h"
+ #include "svcgssd_krb5.h"
++#include "gss_names.h"
+
+ extern char * mech2file(gss_OID mech);
+ #define SVCGSSD_CONTEXT_CHANNEL "/proc/net/rpc/auth.rpcsec.context/channel"
+@@ -315,71 +316,6 @@ print_hexl(const char *description, unsigned char *cp, int length)
+ }
+ #endif
+
+-static int
+-get_krb5_hostbased_name (gss_buffer_desc *name, char **hostbased_name)
+-{
+- char *p, *sname = NULL;
+- if (strchr(name->value, '@') && strchr(name->value, '/')) {
+- if ((sname = calloc(name->length, 1)) == NULL) {
+- printerr(0, "ERROR: get_krb5_hostbased_name failed "
+- "to allocate %d bytes\n", name->length);
+- return -1;
+- }
+- /* read in name and instance and replace '/' with '@' */
+- sscanf(name->value, "%[^@]", sname);
+- p = strrchr(sname, '/');
+- if (p == NULL) { /* The '@' preceeded the '/' */
+- free(sname);
+- return -1;
+- }
+- *p = '@';
+- }
+- *hostbased_name = sname;
+- return 0;
+-}
+-
+-static int
+-get_hostbased_client_name(gss_name_t client_name, gss_OID mech,
+- char **hostbased_name)
+-{
+- u_int32_t maj_stat, min_stat;
+- gss_buffer_desc name;
+- gss_OID name_type = GSS_C_NO_OID;
+- char *cname;
+- int res = -1;
+-
+- *hostbased_name = NULL; /* preset in case we fail */
+-
+- /* Get the client's gss authenticated name */
+- maj_stat = gss_display_name(&min_stat, client_name, &name, &name_type);
+- if (maj_stat != GSS_S_COMPLETE) {
+- pgsserr("get_hostbased_client_name: gss_display_name",
+- maj_stat, min_stat, mech);
+- goto out_err;
+- }
+- if (name.length >= 0xffff) { /* don't overflow */
+- printerr(0, "ERROR: get_hostbased_client_name: "
+- "received gss_name is too long (%d bytes)\n",
+- name.length);
+- goto out_rel_buf;
+- }
+-
+- /* For Kerberos, transform the NT_KRB5_PRINCIPAL name to
+- * an NT_HOSTBASED_SERVICE name */
+- if (g_OID_equal(&krb5oid, mech)) {
+- if (get_krb5_hostbased_name(&name, &cname) == 0)
+- *hostbased_name = cname;
+- } else {
+- printerr(1, "WARNING: unknown/unsupport mech OID\n");
+- }
+-
+- res = 0;
+-out_rel_buf:
+- gss_release_buffer(&min_stat, &name);
+-out_err:
+- return res;
+-}
+-
+ void
+ handle_nullreq(FILE *f) {
+ /* XXX initialize to a random integer to reduce chances of unnecessary
+diff --git a/utils/mount/error.c b/utils/mount/error.c
+index f8fc13f..e06f598 100644
+--- a/utils/mount/error.c
++++ b/utils/mount/error.c
+@@ -215,8 +215,12 @@ void mount_error(const char *spec, const char *mount_point, int error)
+ progname);
+ break;
+ case ENOTDIR:
+- nfs_error(_("%s: mount point %s is not a directory"),
+- progname, mount_point);
++ if (spec)
++ nfs_error(_("%s: mount spec %s or point %s is not a "
++ "directory"), progname, spec, mount_point);
++ else
++ nfs_error(_("%s: mount point %s is not a directory"),
++ progname, mount_point);
+ break;
+ case EBUSY:
+ nfs_error(_("%s: %s is busy or already mounted"),
+diff --git a/utils/mount/nfsmount.conf b/utils/mount/nfsmount.conf
+index 9b8ff4a..aeb3023 100644
+--- a/utils/mount/nfsmount.conf
++++ b/utils/mount/nfsmount.conf
+@@ -133,3 +133,12 @@
+ # RPCGSS security flavors
+ # [none, sys, krb5, krb5i, krb5p ]
+ # Sec=sys
++#
++# Allow Signals to interrupt file operations
++# Intr=True
++#
++# Specifies how the kernel manages its cache of directory
++# Lookupcache=all|none|pos|positive
++#
++# Turn of the caching of that access time
++# noatime=True
+diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
+index 73d6a92..03e3c81 100644
+--- a/utils/nfsd/nfsd.c
++++ b/utils/nfsd/nfsd.c
+@@ -101,7 +101,7 @@ main(int argc, char **argv)
+ int count = NFSD_NPROC, c, i, error = 0, portnum = 0, fd, found_one;
+ char *p, *progname, *port, *rdma_port = NULL;
+ char **haddr = NULL;
+- unsigned int hcounter = 0;
++ int hcounter = 0;
+ int socket_up = 0;
+ unsigned int minorvers = 0;
+ unsigned int minorversset = 0;
+diff --git a/utils/nfsdcltrack/Makefile.am b/utils/nfsdcltrack/Makefile.am
+index a860ffb..7524295 100644
+--- a/utils/nfsdcltrack/Makefile.am
++++ b/utils/nfsdcltrack/Makefile.am
+@@ -1,5 +1,9 @@
+ ## Process this file with automake to produce Makefile.in
+
++# These binaries go in /sbin (not /usr/sbin), and that cannot be
++# overridden at config time. The kernel "knows" the /sbin name.
++sbindir = /sbin
++
+ man8_MANS = nfsdcltrack.man
+ EXTRA_DIST = $(man8_MANS)
+
+diff --git a/utils/statd/callback.c b/utils/statd/callback.c
+index d1cc139..bb7c590 100644
+--- a/utils/statd/callback.c
++++ b/utils/statd/callback.c
+@@ -10,11 +10,13 @@
+ #include <config.h>
+ #endif
+
++#include <unistd.h>
+ #include <netdb.h>
+
+ #include "rpcmisc.h"
+ #include "statd.h"
+ #include "notlist.h"
++#include "ha-callout.h"
+
+ /* Callback notify list. */
+ /* notify_list *cbnl = NULL; ... never used */
+@@ -87,6 +89,13 @@ sm_notify_1_svc(struct stat_chge *argp, struct svc_req *rqstp)
+ xlog(D_CALL, "Received SM_NOTIFY from %s, state: %d",
+ argp->mon_name, argp->state);
+
++ if (!statd_present_address(sap, ip_addr, sizeof(ip_addr))) {
++ xlog_warn("Unrecognized sender address");
++ return ((void *) &result);
++ }
++
++ ha_callout("sm-notify", argp->mon_name, ip_addr, argp->state);
++
+ /* quick check - don't bother if we're not monitoring anyone */
+ if (rtnl == NULL) {
+ xlog_warn("SM_NOTIFY from %s while not monitoring any hosts",
+@@ -94,11 +103,6 @@ sm_notify_1_svc(struct stat_chge *argp, struct svc_req *rqstp)
+ return ((void *) &result);
+ }
+
+- if (!statd_present_address(sap, ip_addr, sizeof(ip_addr))) {
+- xlog_warn("Unrecognized sender address");
+- return ((void *) &result);
+- }
+-
+ /* okir change: statd doesn't remove the remote host from its
+ * internal monitor list when receiving an SM_NOTIFY call from
+ * it. Lockd will want to continue monitoring the remote host
+diff --git a/utils/statd/start-statd b/utils/statd/start-statd
+index cde3583..dcdaf77 100644
+--- a/utils/statd/start-statd
++++ b/utils/statd/start-statd
+@@ -4,8 +4,8 @@
+ # /var/run/rpc.statd.pid).
+ # It should run statd with whatever flags are apropriate for this
+ # site.
+-PATH=/sbin:/usr/sbin
+-if systemctl start statd.service
++PATH="/sbin:/usr/sbin:/bin:/usr/bin"
++if systemctl start rpc-statd.service
+ then :
+ else
+ exec rpc.statd --no-notify
+diff --git a/utils/statd/statd.man b/utils/statd/statd.man
+index 896c2f8..1e5520c 100644
+--- a/utils/statd/statd.man
++++ b/utils/statd/statd.man
+@@ -346,7 +346,8 @@ points due to inactivity.
+ .SS High-availability callouts
+ .B rpc.statd
+ can exec a special callout program during processing of
+-successful SM_MON, SM_UNMON, and SM_UNMON_ALL requests.
++successful SM_MON, SM_UNMON, and SM_UNMON_ALL requests,
++or when it receives SM_NOTIFY.
+ Such a program may be used in High Availability NFS (HA-NFS)
+ environments to track lock state that may need to be migrated after
+ a system reboot.
+@@ -357,15 +358,26 @@ option.
+ The program is run with 3 arguments:
+ The first is either
+ .B add-client
+-or
+ .B del-client
++or
++.B sm-notify
+ depending on the reason for the callout.
+ The second is the
+ .I mon_name
+ of the monitored peer.
+ The third is the
+-.I caller_name
+-of the requesting lock manager.
++.I caller_name
++of the requesting lock manager for
++.B add-client
++or
++.B del-client
++, otherwise it is
++.I IP_address
++of the caller sending SM_NOTIFY.
++The forth is the
++.I state_value
++in the SM_NOTIFY request.
++
+ .SS IPv6 and TI-RPC support
+ TI-RPC is a pre-requisite for supporting NFS on IPv6.
+ If TI-RPC support is built into
diff --git a/core/nfs-utils/nfs-utils.install b/core/nfs-utils/nfs-utils.install
index f6c72d915..7d88ac9c5 100644
--- a/core/nfs-utils/nfs-utils.install
+++ b/core/nfs-utils/nfs-utils.install
@@ -14,14 +14,14 @@ 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
+ if [ "$(vercmp $2 1.2.9-5)" -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
+ ==> IMPORTANT 1.3.0 NFS UTILS CHANGES:
+ ==> This is a rather important upgrade, you are going to have to change systemd services files.
+ ==> NFS-SERVER:
+ ==> systemctl enable nfs-server.service
+ ==> NFS-CLIENT:
+ ==> systemctl enable nfs-client.target
==>
==> Extended configuration options for NFS (clients & server) are available in:
==> /etc/conf.d/nfs-common
diff --git a/core/nfs-utils/nfs-utils_env.sh b/core/nfs-utils/nfs-utils_env.sh
new file mode 100644
index 000000000..42ff93df2
--- /dev/null
+++ b/core/nfs-utils/nfs-utils_env.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+# archlinux config files
+. /etc/conf.d/nfs-common.conf
+. /etc/conf.d/nfs-server.conf
+# config file read by systemd files
+NFS_UTILS_CONFIG=/run/sysconfig/nfs-utils
+
+[[ -d /run/sysconfig ]] || mkdir /run/sysconfig
+[[ -e $NFS_UTILS_CONFIG ]] && rm -f $NFS_UTILS_CONFIG
+
+# /etc/conf.d/nfs-common
+echo "STATDARGS=\"$STATD_OPTS\"" >> $NFS_UTILS_CONFIG
+echo "SMNOTIFYARGS=\"$SMNOTIFY_OPTS\"" >> $NFS_UTILS_CONFIG
+echo "RPCIDMAPDARGS=\"$IDMAPD_OPTS\"" >> $NFS_UTILS_CONFIG
+echo "GSSDARGS=\"$GSSD_OPTS\"" >> $NFS_UTILS_CONFIG
+
+# /etc/conf.d/nfs-server
+echo "RPCMOUNTDARGS=\"$MOUNTD_OPTS\"" >> $NFS_UTILS_CONFIG
+echo "RPCNFSDARGS=\"$NFSD_OPTS\"" >> $NFS_UTILS_CONFIG
+echo "SVCGSSDARGS=\"$SVCGSSD_OPTS\"" >> $NFS_UTILS_CONFIG \ No newline at end of file
diff --git a/core/nfs-utils/nfsd.service b/core/nfs-utils/nfsd.service
deleted file mode 100644
index 83db80657..000000000
--- a/core/nfs-utils/nfsd.service
+++ /dev/null
@@ -1,20 +0,0 @@
-[Unit]
-Description=NFS Server Daemon
-Documentation=man:rpc.nfsd(8)
-After=rpcbind.service
-Requires=rpcbind.service
-Before=nfs-server.target
-PartOf=nfs-server.target
-
-[Service]
-Type=oneshot
-EnvironmentFile=/etc/conf.d/nfs-server.conf
-ExecStart=/usr/bin/rpc.nfsd $NFSD_OPTS $NFSD_COUNT
-ExecStartPost=/usr/bin/exportfs -a
-ExecReload=/usr/bin/exportfs -a -r
-ExecStop=/usr/bin/rpc.nfsd 0
-ExecStopPost=/usr/bin/exportfs -a -u
-RemainAfterExit=yes
-
-[Install]
-WantedBy=multi-user.target
diff --git a/core/nfs-utils/proc-fs-nfsd.mount b/core/nfs-utils/proc-fs-nfsd.mount
deleted file mode 100644
index 26b58b968..000000000
--- a/core/nfs-utils/proc-fs-nfsd.mount
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=NFS Configuration File System
-DefaultDependencies=no
-
-[Mount]
-What=sunrpc
-Where=/proc/fs/nfsd
-Type=nfsd
diff --git a/core/nfs-utils/rpc-gssd.service b/core/nfs-utils/rpc-gssd.service
deleted file mode 100644
index 8674fb2e5..000000000
--- a/core/nfs-utils/rpc-gssd.service
+++ /dev/null
@@ -1,15 +0,0 @@
-[Unit]
-Description=RPC GSS-API Client Daemon
-Documentation=man:rpc.gssd(8)
-After=rpcbind.service var-lib-nfs-rpc_pipefs.mount
-Requires=rpcbind.service var-lib-nfs-rpc_pipefs.mount
-Before=nfs-client.target remote-fs-pre.target
-PartOf=nfs-client.target
-
-[Service]
-Type=forking
-EnvironmentFile=/etc/conf.d/nfs-common.conf
-ExecStart=/usr/bin/rpc.gssd $GSSD_OPTS
-
-[Install]
-WantedBy=multi-user.target
diff --git a/core/nfs-utils/rpc-idmapd.service b/core/nfs-utils/rpc-idmapd.service
deleted file mode 100644
index 609cde6ed..000000000
--- a/core/nfs-utils/rpc-idmapd.service
+++ /dev/null
@@ -1,15 +0,0 @@
-[Unit]
-Description=NFS v4 ID-Name Mapping Daemon
-Documentation=man:rpc.idmapd(8) man:idmapd.conf(5)
-After=var-lib-nfs-rpc_pipefs.mount nfsd.service
-Requires=var-lib-nfs-rpc_pipefs.mount
-Before=nfs-server.target
-PartOf=nfs-server.target
-
-[Service]
-Type=forking
-EnvironmentFile=/etc/conf.d/nfs-common.conf
-ExecStart=/usr/bin/rpc.idmapd $IDMAPD_OPTS
-
-[Install]
-WantedBy=multi-user.target
diff --git a/core/nfs-utils/rpc-mountd.service b/core/nfs-utils/rpc-mountd.service
deleted file mode 100644
index 2969ee6b0..000000000
--- a/core/nfs-utils/rpc-mountd.service
+++ /dev/null
@@ -1,15 +0,0 @@
-[Unit]
-Description=NFS Mount Server Daemon
-Documentation=man:rpc.mountd(8)
-After=rpcbind.service nfsd.service
-Requires=rpcbind.service nfsd.service
-Before=nfs-server.target
-PartOf=nfs-server.target
-
-[Service]
-Type=forking
-EnvironmentFile=/etc/conf.d/nfs-server.conf
-ExecStart=/usr/bin/rpc.mountd $MOUNTD_OPTS
-
-[Install]
-WantedBy=multi-user.target
diff --git a/core/nfs-utils/rpc-statd.service b/core/nfs-utils/rpc-statd.service
deleted file mode 100644
index c5a1c359a..000000000
--- a/core/nfs-utils/rpc-statd.service
+++ /dev/null
@@ -1,16 +0,0 @@
-[Unit]
-Description=NFS v2/3 Network Status Monitor Daemon
-Documentation=man:rpc.statd(8)
-After=rpcbind.service
-Requires=rpcbind.service
-Before=nfs-server.target
-PartOf=nfs-server.target
-Wants=remote-fs-pre.target
-
-[Service]
-Type=forking
-EnvironmentFile=/etc/conf.d/nfs-common.conf
-ExecStart=/usr/bin/rpc.statd $STATD_OPTS
-
-[Install]
-WantedBy=multi-user.target
diff --git a/core/nfs-utils/rpc-svcgssd.service b/core/nfs-utils/rpc-svcgssd.service
deleted file mode 100644
index f52f26aec..000000000
--- a/core/nfs-utils/rpc-svcgssd.service
+++ /dev/null
@@ -1,15 +0,0 @@
-[Unit]
-Description=RPC GSS-API Server Daemon
-Documentation=man:rpc.svcgssd(8)
-After=rpcbind.service
-Requires=rpcbind.service
-Before=nfs-server.target
-PartOf=nfs-server.target
-
-[Service]
-Type=forking
-EnvironmentFile=/etc/conf.d/nfs-server.conf
-ExecStart=/usr/bin/rpc.svcgssd $SVCGSSD_OPTS
-
-[Install]
-WantedBy=multi-user.target
diff --git a/core/nfs-utils/start-statd.patch b/core/nfs-utils/start-statd.patch
deleted file mode 100644
index 6f6f1194d..000000000
--- a/core/nfs-utils/start-statd.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- nfs-utils-1.2.8/utils/statd/start-statd.old 2013-05-23 11:35:10.408221686 +0200
-+++ nfs-utils-1.2.8/utils/statd/start-statd 2013-05-23 11:35:22.191356904 +0200
-@@ -4,6 +4,6 @@
- # /var/run/rpc.statd.pid).
- # It should run statd with whatever flags are apropriate for this
- # site.
--PATH=/sbin:/usr/sbin
-+PATH=/sbin:/usr/sbin:/usr/bin
- exec rpc.statd --no-notify
-
diff --git a/core/nfs-utils/var-lib-nfs-rpc_pipefs.mount b/core/nfs-utils/var-lib-nfs-rpc_pipefs.mount
deleted file mode 100644
index c41665822..000000000
--- a/core/nfs-utils/var-lib-nfs-rpc_pipefs.mount
+++ /dev/null
@@ -1,7 +0,0 @@
-[Unit]
-Description=RPC Pipe File System
-
-[Mount]
-What=rpc_pipefs
-Where=/var/lib/nfs/rpc_pipefs
-Type=rpc_pipefs
diff --git a/core/rpcbind/PKGBUILD b/core/rpcbind/PKGBUILD
index d50b2bf4c..25b600581 100644
--- a/core/rpcbind/PKGBUILD
+++ b/core/rpcbind/PKGBUILD
@@ -1,23 +1,28 @@
-# $Id: PKGBUILD 193786 2013-08-31 10:51:12Z tpowa $
+# $Id: PKGBUILD 215487 2014-06-26 19:15:57Z tpowa $
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
pkgname=rpcbind
pkgver=0.2.1
-pkgrel=2
+pkgrel=5
pkgdesc="portmap replacement which supports RPC over various protocols"
arch=(i686 x86_64)
+backup=('etc/conf.d/rpcbind')
depends=('bash' 'glibc' 'libtirpc')
url="http://rpcbind.sourceforge.net"
license=('custom')
replaces=('portmap')
source=(http://downloads.sourceforge.net/sourceforge/rpcbind/rpcbind-0.2.1.tar.bz2
rpcbind-sunrpc.patch
- rpcbind.service)
+ rpcbind.service
+ rpcbind.socket
+ rpcbind.conf)
install=rpcbind.install
md5sums=('0a5f9c2142af814c55d957aaab3bcc68'
'c02ac36a98baac70b8a26190524b7b73'
- 'a7b23a32be2eb52d7dec52da36d4eba1'
-)
+ '0f493a590c250267034e230e7bf1f894'
+ 'e5a205cd7402fedaf74a744b2a22f0ad'
+ 'd4c74d1be9f98344af138a15ad3b6f8c')
+
prepare() {
cd $srcdir/$pkgname-$pkgver
# patch for iana services file
@@ -26,7 +31,7 @@ prepare() {
build() {
cd $srcdir/$pkgname-$pkgver
- ./configure --prefix=/usr --with-rpcuser=rpc --enable-warmstarts --with-statedir=/run
+ ./configure --prefix=/usr --with-rpcuser=rpc --enable-warmstarts --with-statedir=/var/lib/rpcbind
make
}
@@ -38,10 +43,21 @@ check() {
package() {
cd $srcdir/$pkgname-$pkgver
make DESTDIR=$pkgdir install
+ # install rpcbind config file
+ install -D -m644 $srcdir/rpcbind.conf $pkgdir/etc/conf.d/rpcbind
# install missing man page - https://bugs.archlinux.org/task/21271
install -m644 man/rpcinfo.8 $pkgdir/usr/share/man/man8/
# install systemd service file
install -D -m644 $srcdir/rpcbind.service $pkgdir/usr/lib/systemd/system/rpcbind.service
+ # install system socket activation
+ install -D -m644 $srcdir/rpcbind.socket $pkgdir/usr/lib/systemd/system/rpcbind.socket
+ # add symlinks
+ mkdir $pkgdir/usr/lib/systemd/system/sockets.target.wants
+ mkdir $pkgdir/usr/lib/systemd/system/multi-user.target.wants
+ ln -sf ../rpcbind.socket $pkgdir/usr/lib/systemd/system/sockets.target.wants/rpcbind.socket
+ ln -sf ../rpcbind.service $pkgdir/usr/lib/systemd/system/multi-user.target.wants/rpcbind.service
+ # add state directory
+ install -d -m 700 -o 32 -g 32 $pkgdir/var/lib/rpcbind
# install license
install -D -m644 COPYING $pkgdir/usr/share/licenses/rpcbind/COPYING
}
diff --git a/core/rpcbind/rpcbind.conf b/core/rpcbind/rpcbind.conf
new file mode 100644
index 000000000..4b35e3749
--- /dev/null
+++ b/core/rpcbind/rpcbind.conf
@@ -0,0 +1,3 @@
+#
+# Optional arguments passed to rpcbind. See rpcbind(8)
+RPCBIND_ARGS=""
diff --git a/core/rpcbind/rpcbind.service b/core/rpcbind/rpcbind.service
index 3bc764efc..1cb27e5c8 100644
--- a/core/rpcbind/rpcbind.service
+++ b/core/rpcbind/rpcbind.service
@@ -1,13 +1,11 @@
[Unit]
-Description=RPC Bind
-After=network.target
-Wants=rpcbind.target
-Before=rpcbind.target
+Description=RPC bind service
+Requires=rpcbind.socket
[Service]
Type=forking
-ExecStart=/usr/bin/rpcbind
-Restart=always
+EnvironmentFile=/etc/conf.d/rpcbind
+ExecStart=/usr/bin/rpcbind -w ${RPCBIND_ARGS}
[Install]
-WantedBy=multi-user.target
+Also=rpcbind.socket
diff --git a/core/rpcbind/rpcbind.socket b/core/rpcbind/rpcbind.socket
new file mode 100644
index 000000000..d63c1d972
--- /dev/null
+++ b/core/rpcbind/rpcbind.socket
@@ -0,0 +1,8 @@
+[Unit]
+Description=RPCbind Server Activation Socket
+
+[Socket]
+ListenStream=/var/run/rpcbind.sock
+
+[Install]
+WantedBy=sockets.target