diff --git a/.gitignore b/.gitignore
index fa83b0e..e9ab4a6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
cscope.in.out
cscope.out
cscope.po.out
+fedfs-utils-*.tar.gz
ChangeLog
Doxygen/
.*.swp
diff --git a/Makefile.am b/Makefile.am
index 52c8329..b374969 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,10 +24,11 @@
##
AUTOMAKE_OPTIONS = foreign
-SUBDIRS = doc src
+SUBDIRS = doc src contrib
dist_noinst_SCRIPTS = autogen.sh
EXTRA_DIST = ChangeLog COPYING README INSTALL doxy.cfg .gitignore
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in ChangeLog
ChangeLog:
diff --git a/configure.ac b/configure.ac
index 574e64b..7d446db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,6 +125,8 @@ esac
AC_SUBST([root_sbindir])
AC_CONFIG_FILES([Makefile
+ contrib/Makefile
+ contrib/init/Makefile
doc/Makefile
doc/ldap/Makefile
doc/man/Makefile
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
new file mode 100644
index 0000000..ee19f6b
--- /dev/null
+++ b/contrib/Makefile.am
@@ -0,0 +1,29 @@
+##
+## @file contrib/Makefile.am
+## @brief Process this file with automake to produce contrib/Makefile.in
+##
+
+##
+## Copyright 2011 Oracle. All rights reserved.
+##
+## This file is part of fedfs-utils.
+##
+## fedfs-utils is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License version 2.0 as
+## published by the Free Software Foundation.
+##
+## fedfs-utils is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License version 2.0 for more details.
+##
+## You should have received a copy of the GNU General Public License
+## version 2.0 along with fedfs-utils. If not, see:
+##
+## http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
+##
+
+SUBDIRS = init
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
+DISTCLEANFILES = Makefile.in
diff --git a/contrib/init/Makefile.am b/contrib/init/Makefile.am
new file mode 100644
index 0000000..c8740ff
--- /dev/null
+++ b/contrib/init/Makefile.am
@@ -0,0 +1,29 @@
+##
+## @file contrib/init/Makefile.am
+## @brief Process this file with automake to produce contrib/init/Makefile.in
+##
+
+##
+## Copyright 2011 Oracle. All rights reserved.
+##
+## This file is part of fedfs-utils.
+##
+## fedfs-utils is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License version 2.0 as
+## published by the Free Software Foundation.
+##
+## fedfs-utils is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License version 2.0 for more details.
+##
+## You should have received a copy of the GNU General Public License
+## version 2.0 along with fedfs-utils. If not, see:
+##
+## http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
+##
+
+EXTRA_DIST = fedfs README rpcfedfsd rpcfedfsd.service
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
+DISTCLEANFILES = Makefile.in
diff --git a/contrib/init/README b/contrib/init/README
new file mode 100644
index 0000000..45ed56a
--- /dev/null
+++ b/contrib/init/README
@@ -0,0 +1,26 @@
+Date: Thu Nov 10 11:37:07 EST 2011
+Author: Chuck Lever <chuck.lever@oracle.com>
+
+Items in the contrib/init subdirectory are provided on an as-is basis as a
+courtesy. These items are not tested as part of the fedfs-utils check-in
+or release process. They are not installed by the fedfs-utils Makefiles,
+but must be installed as needed by hand.
+
+Use them at your own risk, but do report bugs to us and we will try to
+see that issues are addressed in the fedfs-utils distribution.
+
+
+Item Purpose
+---- --------
+
+fedfs Sample /etc/sysconfig/fedfs configuration file
+
+README This file
+
+rpcfedfsd Sample SysV start-up script for rpc.fedfsd; typically
+ installed in /etc/init.d, and then activated with the
+ equivalent of "chkconfig rpcfedfsd on"
+
+rpcfedfsd.service Sample systemd service file for rpc.fedfsd; see
+ http://0pointer.de/blog/projects/systemd-for-admins-3.html
+ for further details
diff --git a/contrib/init/fedfs b/contrib/init/fedfs
new file mode 100644
index 0000000..aa40100
--- /dev/null
+++ b/contrib/init/fedfs
@@ -0,0 +1,11 @@
+# /etc/sysconfig/fedfs
+#
+# This configuration file controls the behavior of the rpc.fedfsd
+# daemon, part of the fedfs-utils package. For the vast majority
+# of users, there shouldn't be any need to alter the contents of
+# this file at all.
+
+#
+# Optional arguments passed to rpc.fedfsd. See rpc.fedfsd(8)
+#
+#RPCFEDFSDARGS="--debug --uid 501 --gid 501 --port 45678"
diff --git a/contrib/init/rpcfedfsd b/contrib/init/rpcfedfsd
new file mode 100755
index 0000000..491bd42
--- /dev/null
+++ b/contrib/init/rpcfedfsd
@@ -0,0 +1,119 @@
+#!/bin/bash
+#
+# rpcfedfsd Start up and shut down FedFS admin service
+#
+# chkconfig: 345 19 83
+# description: Starts user-level daemon that handles FedFS administrative requests
+
+### BEGIN INIT INFO
+# Provides: rpcfedfsd
+# Required-Start: $network $syslog
+# Required-Stop: $network $syslog
+# Default-Start: 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Starts the rpc.fedfsd daemon
+# Description: Starts daemon that processes FedFS administrative \
+# requests shared file system exports.
+### END INIT INFO
+
+##
+## Copyright 2011 Oracle. All rights reserved.
+##
+## rpcfedfsd is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License version 2.0 as
+## published by the Free Software Foundation.
+##
+## rpcfedfsd is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License version 2.0 for more details.
+##
+## A copy of the GNU General Public License version 2.0 is
+## available here:
+##
+## http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
+##
+
+# Source function library.
+. /etc/init.d/functions
+
+# Source networking configuration.
+[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network
+
+# Check for, and source, configuration file; otherwise set defaults
+[ -f /etc/sysconfig/fedfs ] && . /etc/sysconfig/fedfs
+
+RETVAL=0
+prog="rpc.fedfsd"
+LOCKFILE=/var/lock/subsys/$prog
+uid=`id | cut -d\( -f1 | cut -d= -f2`
+
+case "$1" in
+ start|condstart)
+ # Check that networking is up.
+ [ "${NETWORKING}" != "yes" ] && exit 6
+
+ [ ! -x /usr/sbin/rpc.fedfsd ] && exit 5
+
+ # Only root can start the service
+ [ $uid -ne 0 ] && exit 4
+
+ # Make sure the daemon is not already running.
+ [ "$1" = "condstart" -a -n "`pidofproc $prog`" ] && {
+ killproc $prog "-SIGHUP" > /dev/null
+ exit 0
+ }
+ [ "$1" = "start" ] && {
+ if status $prog > /dev/null ; then
+ exit 0
+ fi
+ }
+ rm -f $LOCKFILE
+
+ echo -n $"Starting RPC fedfsd: "
+
+ # Start daemon.
+ daemon $prog ${RPCFEDFSDARGS}
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch $LOCKFILE
+ ;;
+ stop)
+ # Only root can stop the service
+ [ $uid -ne 0 ] && exit 4
+
+ # Stop daemon.
+ echo -n $"Stopping RPC fedfsd: "
+ killproc $prog
+ RETVAL=$?
+ echo
+ rm -f $LOCKFILE
+ ;;
+ status)
+ status rpc.fedfsd
+ RETVAL=$?
+ ;;
+ restart|reload|force-reload)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ condrestart|try-restart)
+ if [ -f $LOCKFILE ]; then
+ $0 restart
+ RETVAL=$?
+ fi
+ ;;
+ condstop)
+ if [ -f $LOCKFILE ]; then
+ $0 stop
+ RETVAL=$?
+ fi
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|force-reload|condstart|condrestart|try-restart|status|condstop}"
+ RETVAL=2
+ ;;
+esac
+
+exit $RETVAL
diff --git a/contrib/init/rpcfedfsd.service b/contrib/init/rpcfedfsd.service
new file mode 100644
index 0000000..f41e013
--- /dev/null
+++ b/contrib/init/rpcfedfsd.service
@@ -0,0 +1,29 @@
+##
+## Copyright 2011 Red Hat. All rights reserved.
+##
+## rpcfedfsd.service is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License version 2.0 as
+## published by the Free Software Foundation.
+##
+## rpcfedfsd.service is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License version 2.0 for more details.
+##
+## A copy of the GNU General Public License version 2.0 is
+## available here:
+##
+## http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
+##
+
+[Unit]
+Description=FedFS administrative service daemon
+After=syslog.target
+
+[Service]
+EnvironmentFile=-/etc/sysconfig/fedfs
+ExecStart=/usr/sbin/rpc.fedfsd $RPCFEDFSDARGS
+Type=forking
+
+[Install]
+WantedBy=multi-user.target
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 6acc741..8ee4c63 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -25,5 +25,6 @@
EXTRA_DIST = CheckInTests
SUBDIRS = man ldap rpcl
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am
index e8f2d8e..f01f1b0 100644
--- a/doc/man/Makefile.am
+++ b/doc/man/Makefile.am
@@ -39,5 +39,6 @@ NSDB_CLIENT_CMDS = nsdb-create-fsl.8 nsdb-create-fsn.8 \
dist_man7_MANS = fedfs.7
dist_man8_MANS = rpc.fedfsd.8 mount.fedfs.8 fedfs-map-nfs4.8 \
nsdbparams.8 $(FEDFS_CLIENT_CMDS) $(NSDB_CLIENT_CMDS)
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
diff --git a/doc/rpcl/Makefile.am b/doc/rpcl/Makefile.am
index b45aa6a..488b382 100644
--- a/doc/rpcl/Makefile.am
+++ b/doc/rpcl/Makefile.am
@@ -32,7 +32,8 @@ GENFILES = $(GENFILES_CLNT) $(GENFILES_SVC) $(GENFILES_XDR) \
EXTRA_DIST = fedfs_admin.x
BUILT_SOURCES = $(GENFILES)
-CLEANFILES = $(GENFILES) cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = $(GENFILES) cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
$(GENFILES_H): %.h: %.x $(RPCGEN)
diff --git a/src/Makefile.am b/src/Makefile.am
index ae32fdf..2b03192 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -27,5 +27,6 @@ SUBDIRS = include libxlog libadmin libnsdb libjunction \
libparser libpath libsi \
fedfsc fedfsd nsdbc nsdbparams resolve-junction \
mount
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
diff --git a/src/fedfsc/Makefile.am b/src/fedfsc/Makefile.am
index 3c0cfdf..c91a102 100644
--- a/src/fedfsc/Makefile.am
+++ b/src/fedfsc/Makefile.am
@@ -37,7 +37,8 @@ LDADD = $(LIBTIRPC) $(LIBLDAP) $(LIBLBER) \
$(top_builddir)/src/libnsdb/libnsdb.a \
$(top_builddir)/src/libpath/libpath.a \
$(top_builddir)/src/libxlog/libxlog.a
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \
diff --git a/src/fedfsd/Makefile.am b/src/fedfsd/Makefile.am
index 4b313eb..78bfc90 100644
--- a/src/fedfsd/Makefile.am
+++ b/src/fedfsd/Makefile.am
@@ -34,7 +34,8 @@ fedfsd_LDADD = $(LIBTIRPC) $(LIBLDAP) $(LIBLBER) \
$(top_builddir)/src/libjunction/libjunction.a \
$(top_builddir)/src/libpath/libpath.a \
$(top_builddir)/src/libxlog/libxlog.a
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index c875ac1..6244670 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -26,5 +26,6 @@
noinst_HEADERS = fedfs_admin.h fedfs.h getsrvinfo.h gpl-boiler.h \
junction.h list.h nsdb.h parse_opt.h path.h \
token.h xlog.h
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
diff --git a/src/libadmin/Makefile.am b/src/libadmin/Makefile.am
index d48f698..ac0095b 100644
--- a/src/libadmin/Makefile.am
+++ b/src/libadmin/Makefile.am
@@ -25,7 +25,8 @@
noinst_LIBRARIES = libadmin.a
libadmin_a_SOURCES = fedfs_admin_clnt.c fedfs_admin_svc.c fedfs_admin_xdr.c
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
# Squelch compiler warnings for rpcgen-produced source code
diff --git a/src/libjunction/Makefile.am b/src/libjunction/Makefile.am
index c4cce62..b9e7b1a 100644
--- a/src/libjunction/Makefile.am
+++ b/src/libjunction/Makefile.am
@@ -25,7 +25,8 @@
noinst_LIBRARIES = libjunction.a
libjunction_a_SOURCES = junction.c
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \
diff --git a/src/libnsdb/Makefile.am b/src/libnsdb/Makefile.am
index 3654c93..ddf770d 100644
--- a/src/libnsdb/Makefile.am
+++ b/src/libnsdb/Makefile.am
@@ -27,7 +27,8 @@ noinst_HEADERS = nsdb-internal.h
noinst_LIBRARIES = libnsdb.a
libnsdb_a_SOURCES = administrator.c annotation.c display.c fileserver.c \
ldap.c nsdb.c sqlite.c
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \
diff --git a/src/libparser/Makefile.am b/src/libparser/Makefile.am
index f24d344..2ef8549 100644
--- a/src/libparser/Makefile.am
+++ b/src/libparser/Makefile.am
@@ -25,7 +25,8 @@
noinst_LIBRARIES = libparser.a
libparser_a_SOURCES = parse_opt.c token.c
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \
diff --git a/src/libpath/Makefile.am b/src/libpath/Makefile.am
index 0a443cb..3b13423 100644
--- a/src/libpath/Makefile.am
+++ b/src/libpath/Makefile.am
@@ -25,7 +25,8 @@
noinst_LIBRARIES = libpath.a
libpath_a_SOURCES = path.c
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \
diff --git a/src/libsi/Makefile.am b/src/libsi/Makefile.am
index 2924168..af9fe8c 100644
--- a/src/libsi/Makefile.am
+++ b/src/libsi/Makefile.am
@@ -25,7 +25,8 @@
noinst_LIBRARIES = libsi.a
libsi_a_SOURCES = getsrvinfo.c
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \
diff --git a/src/libxlog/Makefile.am b/src/libxlog/Makefile.am
index 124df23..677e7b8 100644
--- a/src/libxlog/Makefile.am
+++ b/src/libxlog/Makefile.am
@@ -25,7 +25,8 @@
noinst_LIBRARIES = libxlog.a
libxlog_a_SOURCES = xlog.c
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \
diff --git a/src/mount/Makefile.am b/src/mount/Makefile.am
index 9a97fb4..7dbab03 100644
--- a/src/mount/Makefile.am
+++ b/src/mount/Makefile.am
@@ -33,7 +33,8 @@ mount_fedfs_SOURCES = main.c
# mount.fedfs must never link against libraries in /usr
mount_fedfs_LDADD = $(LIBRESOLV) \
$(top_builddir)/src/libsi/libsi.a
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \
diff --git a/src/nsdbc/Makefile.am b/src/nsdbc/Makefile.am
index e409d9b..1f8b79f 100644
--- a/src/nsdbc/Makefile.am
+++ b/src/nsdbc/Makefile.am
@@ -34,7 +34,8 @@ LDADD = $(LIBLDAP) $(LIBLBER) \
$(top_builddir)/src/libxlog/libxlog.a \
$(top_builddir)/src/libjunction/libjunction.a \
$(top_builddir)/src/libpath/libpath.a
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \
diff --git a/src/nsdbparams/Makefile.am b/src/nsdbparams/Makefile.am
index 9807743..a9a0fa1 100644
--- a/src/nsdbparams/Makefile.am
+++ b/src/nsdbparams/Makefile.am
@@ -31,7 +31,8 @@ LDADD = $(LIBLDAP) $(LIBLBER) \
$(top_builddir)/src/libjunction/libjunction.a \
$(top_builddir)/src/libpath/libpath.a \
$(top_builddir)/src/libxlog/libxlog.a
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \
diff --git a/src/resolve-junction/Makefile.am b/src/resolve-junction/Makefile.am
index 90508a3..9149042 100644
--- a/src/resolve-junction/Makefile.am
+++ b/src/resolve-junction/Makefile.am
@@ -34,7 +34,8 @@ LDADD = $(LIBLDAP) $(LIBLBER) \
$(top_builddir)/src/libjunction/libjunction.a \
$(top_builddir)/src/libpath/libpath.a \
$(top_builddir)/src/libxlog/libxlog.a
-CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+CLEANFILES = cscope.in.out cscope.out cscope.po.out *~
DISTCLEANFILES = Makefile.in
AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \