1
0
forked from rpms/rpcbind

Reworked how the state directory, use in warm starts, is defined.

This commit is contained in:
Steve Dickson 2007-04-03 12:48:46 +00:00
parent f766b07fc0
commit 5af042e80a
2 changed files with 67 additions and 9 deletions

View File

@ -1,13 +1,13 @@
--- rpcbind-0.1.4/man/rpcbind.8.orig 2004-10-25 08:07:44.000000000 -0400
+++ rpcbind-0.1.4/man/rpcbind.8 2006-08-10 16:19:55.000000000 -0400
@@ -131,6 +131,14 @@ to use non-privileged ports for outgoing
+++ rpcbind-0.1.4/man/rpcbind.8 2007-04-03 08:31:57.000000000 -0400
@@ -131,6 +131,14 @@
clients from using
.Nm
to connect to services from a privileged port.
+.It Fl w
+Cause
+.Nm
+to do a "warm start" by read a state file (in /tmp) when
+to do a "warm start" by read a state file when
+.Nm
+starts up. The state file is created when
+.Nm
@ -15,8 +15,39 @@
.El
.Sh NOTES
All RPC servers must be restarted if
--- rpcbind-0.1.4/src/Makefile.am.orig 2006-08-10 14:56:50.000000000 -0400
+++ rpcbind-0.1.4/src/Makefile.am 2006-08-10 15:36:04.000000000 -0400
--- rpcbind-0.1.4/src/warmstart.c.orig 2004-10-25 08:07:42.000000000 -0400
+++ rpcbind-0.1.4/src/warmstart.c 2007-04-03 08:32:21.000000000 -0400
@@ -46,17 +46,21 @@
#include <syslog.h>
#include <unistd.h>
+#include "config.h"
#include "rpcbind.h"
/*
* XXX this code is unsafe and is not used. It should be made safe.
*/
+#ifndef RPCBIND_STATEDIR
+#define RPCBIND_STATEDIR "/tmp"
+#endif
/* These files keep the pmap_list and rpcb_list in XDR format */
-#define RPCBFILE "/tmp/rpcbind.file"
+#define RPCBFILE RPCBIND_STATEDIR "/rpcbind.file"
#ifdef PORTMAP
-#define PMAPFILE "/tmp/portmap.file"
+#define PMAPFILE RPCBIND_STATEDIR "/portmap.file"
#endif
static bool_t write_struct __P((char *, xdrproc_t, void *));
--- /dev/null 2007-04-02 10:04:26.771658626 -0400
+++ rpcbind-0.1.4/src/config.h.in 2007-04-03 08:31:57.000000000 -0400
@@ -0,0 +1,2 @@
+/* this define where the state files live for warm starts */
+#undef RPCBIND_STATEDIR
--- rpcbind-0.1.4/src/Makefile.am.orig 2007-04-03 08:31:44.000000000 -0400
+++ rpcbind-0.1.4/src/Makefile.am 2007-04-03 08:31:57.000000000 -0400
@@ -1,5 +1,14 @@
INCLUDES = -I$(srcdir)/tirpc -DPORTMAP -DINET6 -DVERSION="\"$(VERSION)\"" \
-D_GNU_SOURCE -Wall -pipe
@ -32,7 +63,7 @@
bin_PROGRAMS = rpcbind rpcinfo
@@ -18,10 +27,6 @@ rpcbind_LDFLAGS = -lpthread -ltirpc
@@ -18,10 +27,6 @@
rpcbind_LDADD = $(LIB_TIRPC)
AM_CPPFLAGS = -I/usr/include/tirpc -DCHECK_LOCAL -DPORTMAP \
-DFACILITY=LOG_MAIL -DSEVERITY=LOG_INFO
@ -43,9 +74,21 @@
$(rpcbind_OBJECTS) : security.o util.o check_bound.o pmap_svc.o \
rpcb_svc.o rpcb_svc_com.o rpcb_svc_4.o \
--- rpcbind-0.1.4/configure.in.orig 2006-08-10 10:47:42.000000000 -0400
+++ rpcbind-0.1.4/configure.in 2006-08-10 15:37:29.000000000 -0400
@@ -18,6 +18,14 @@ AC_ARG_ENABLE(debug,[ --enable-debug
--- rpcbind-0.1.4/configure.in.orig 2007-04-03 08:31:44.000000000 -0400
+++ rpcbind-0.1.4/configure.in 2007-04-03 08:31:57.000000000 -0400
@@ -9,7 +9,10 @@
##AC_PROG_RANLIB
AC_HEADER_DIRENT
AC_PREFIX_DEFAULT(/usr)
-
+
+AC_CONFIG_SRCDIR([src/config.h.in])
+AC_CONFIG_HEADERS([src/config.h])
+
AC_ARG_ENABLE(debug,[ --enable-debug Turns on rpcbind debugging],
[case "${enableval}" in
yes) debug=true ;;
@@ -18,6 +21,23 @@
esac],[debug=false])
AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
@ -56,6 +99,15 @@
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-warmstarts) ;;
+ esac],[warmstarts=false])
+AM_CONDITIONAL(WARMSTART, test x$warmstarts = xtrue)
+
+if test "$warmstarts" = "true" ; then
+ AC_ARG_WITH(statedir,
+ [ --with-statedir=/foo use state dir /foo [/tmp]],
+ statedir=$withval,
+ statedir=/tmp)
+ AC_SUBST(statedir)
+ AC_DEFINE_UNQUOTED(RPCBIND_STATEDIR, "$statedir", [This defines the location where the state files will be kept for warm starts])
+fi
+
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h \
netinet/in.h stdlib.h string.h \

View File

@ -25,6 +25,7 @@ Obsoletes: portmap < 0.1.4-1
Patch1: rpcbind-0.1.4-compile.patch
Patch2: rpcbind-0.1.4-debug.patch
Patch3: rpcbind-0.1.4-warmstarts.patch
Patch4: rpcbind-0.1.4-rpcuser.patch
%description
The rpcbind utility is a server that converts RPC program numbers into
@ -37,6 +38,7 @@ RPC calls on a server on that machine.
%patch1 -p1
%patch2 -p1
%patch3 -p1
#%patch4 -p1
%build
%ifarch s390 s390x
@ -45,11 +47,14 @@ PIE="-fPIE"
PIE="-fpie"
%endif
export PIE
RPCBDIR=/var/lib/rpcbind
CFLAGS="`echo $RPM_OPT_FLAGS $ARCH_OPT_FLAGS $PIE`"
autoreconf -fisv
%configure CFLAGS="$CFLAGS" LDFLAGS="-pie" \
--enable-warmstarts \
--with-statedir="$RPCBDIR" \
--enable-debug
make all
@ -117,6 +122,7 @@ fi
pages don't conflict.
- Added the creation of /var/lib/rpcinfo which will be
used to store state files.
- Make rpcbind run with the 'rpc' uid/gid when it exists.
* Wed Feb 21 2007 Steve Dickson <steved@redhat.com> 0.1.4-1
- Initial commit