1 diff --git a/configure.in b/configure.in
2 index 9a64b45..0e2f163 100644
5 @@ -18,6 +21,23 @@ AC_ARG_ENABLE(debug,[ --enable-debug Turns on rpcbind debugging],
7 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
9 +AC_ARG_ENABLE(warmstarts,[ --enable-warmstarts Enables Warm Starts],
10 + [case "${enableval}" in
11 + yes) warmstarts=true ;;
12 + no) warmstarts=no ;;
13 + *) AC_MSG_ERROR(bad value ${enableval} for --enable-warmstarts) ;;
14 + esac],[warmstarts=false])
15 +AM_CONDITIONAL(WARMSTART, test x$warmstarts = xtrue)
17 +if test "$warmstarts" = "true" ; then
18 + AC_ARG_WITH(statedir,
19 + [ --with-statedir=/foo use state dir /foo [/tmp]],
23 + AC_DEFINE_UNQUOTED(RPCBIND_STATEDIR, "$statedir", [This defines the location where the state files will be kept for warm starts])
26 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h \
27 netinet/in.h stdlib.h string.h \
28 sys/param.h sys/socket.h \
29 diff --git a/man/rpcbind.8 b/man/rpcbind.8
30 index 2d59ce8..7985f0f 100644
33 @@ -131,6 +131,14 @@ to use non-privileged ports for outgoing connections, preventing non-privileged
36 to connect to services from a privileged port.
40 +to do a "warm start" by read a state file when
42 +starts up. The state file is created when
47 All RPC servers must be restarted if
48 diff --git a/src/Makefile.am b/src/Makefile.am
49 index 52d3857..fd80847 100644
53 INCLUDES = -I$(srcdir)/tirpc -DPORTMAP -DINET6 -DVERSION="\"$(VERSION)\"" \
54 -D_GNU_SOURCE -Wall -pipe
56 +INCLUDES += -DRPCBIND_DEBUG -DSVC_RUN_DEBUG -DDEBUG_RMTCALL
57 +INCLUDES += -DND_DEBUG -DBIND_DEBUG
61 +INCLUDES += -DWARMSTART
65 bin_PROGRAMS = rpcbind rpcinfo
67 @@ -18,10 +27,6 @@ rpcbind_LDFLAGS = -lpthread -ltirpc
68 rpcbind_LDADD = $(LIB_TIRPC)
69 AM_CPPFLAGS = -I/usr/include/tirpc -DCHECK_LOCAL -DPORTMAP \
70 -DFACILITY=LOG_MAIL -DSEVERITY=LOG_INFO
72 -INCLUDES += -DRPCBIND_DEBUG -DSVC_RUN_DEBUG -DDEBUG_RMTCALL
73 -INCLUDES += -DND_DEBUG -DBIND_DEBUG
76 $(rpcbind_OBJECTS) : security.o util.o check_bound.o pmap_svc.o \
77 rpcb_svc.o rpcb_svc_com.o rpcb_svc_4.o \
78 diff --git a/src/warmstart.c b/src/warmstart.c
79 index 4a40639..6a50c41 100644
90 * XXX this code is unsafe and is not used. It should be made safe.
93 +#ifndef RPCBIND_STATEDIR
94 +#define RPCBIND_STATEDIR "/tmp"
97 /* These files keep the pmap_list and rpcb_list in XDR format */
98 -#define RPCBFILE "/tmp/rpcbind.file"
99 +#define RPCBFILE RPCBIND_STATEDIR "/rpcbind.file"
101 -#define PMAPFILE "/tmp/portmap.file"
102 +#define PMAPFILE RPCBIND_STATEDIR "/portmap.file"
105 static bool_t write_struct __P((char *, xdrproc_t, void *));