diff -urN ippool-1.3/ippool_config.c ippool-1.3.patched/ippool_config.c
--- ippool-1.3/ippool_config.c	2008-02-03 10:46:58.000000000 -0500
+++ ippool-1.3.patched/ippool_config.c	2013-08-20 17:07:55.327868764 -0400
@@ -1388,19 +1388,26 @@
 
 	opterr = 0;		/* no error messages please */
 
-	opt = getopt(argc, argv, "qR:");
-	switch (opt) {
-	case 'q':
-		opt_quiet = 1;
-		arg++;
-		break;
-	case 'R':
-		strncpy(server, optarg, sizeof(server));
-		arg += 2;
-		ippool_set_prompt(server);
-		break;
-	default:
-		break;
+	while ((opt = getopt(argc, argv, "qR:f:")) != -1)
+	{
+		switch (opt)
+		{
+			case 'f':
+				ippool_config_restore(optarg);
+				ippool_act_exit(0, 0, 0, 0);
+				break;
+			case 'q':
+				opt_quiet = 1;
+				arg++;
+				break;
+			case 'R':
+				strncpy(server, optarg, sizeof(server));
+				arg += 2;
+				ippool_set_prompt(server);
+				break;
+			default:
+				break;
+		}
 	}
 
 	/* If user supplied arguments, send them to the CLI now and immediately exit.
diff -urN ippool-1.3/ippool_main.c ippool-1.3.patched/ippool_main.c
--- ippool-1.3/ippool_main.c	2008-02-03 10:46:58.000000000 -0500
+++ ippool-1.3.patched/ippool_main.c	2013-08-22 10:57:42.483011226 -0400
@@ -47,6 +47,8 @@
 #include "usl.h"
 #include "ippool_private.h"
 
+#define DEFAULT_PID_PATH "/opt/ippool/var/run/ippoold.pid"
+
 /* Patch information.
  * Each patch adds its version number to this array.
  */
@@ -65,8 +67,9 @@
 int				ippool_opt_debug = 0;
 int				ippool_opt_remote_rpc = 0;
 int				ippool_opt_log_facility = LOG_DAEMON;
+char*				ippool_opt_pid_file = NULL;
 
-
+static void ippool_persist_pid(char *pidfile);
 static void ippool_init(void);
 static void ippool_cleanup(void);
 static int ippool_parse_args(int argc, char **argv);
@@ -156,8 +159,11 @@
 	int opt;
 	int result = 0;
 
-	while((opt = getopt(argc, argv, "dL:fRh")) != -1) {
+	while((opt = getopt(argc, argv, "dL:fRhp:")) != -1) {
 		switch(opt) {
+		case 'p':
+			ippool_opt_pid_file = strdup(optarg);
+			break;
 		case 'h':
 			usage(argv, 0);
 			break;
@@ -181,6 +187,8 @@
 		}
 	}
 
+	if (ippool_opt_pid_file == NULL) ippool_opt_pid_file = strdup(DEFAULT_PID_PATH);
+
 	return result;
 }
 
@@ -334,6 +342,7 @@
 	}
 #endif
 	ippool_my_pid = getpid();
+	ippool_persist_pid(ippool_opt_pid_file);
 
 	atexit(ippool_cleanup);
 	IPPOOL_DEBUG("%s (%s %s)", __FUNCTION__, __DATE__, __TIME__);
@@ -347,6 +356,13 @@
 	ippool_api_init();
 }
 
+static void ippool_persist_pid(char *pidfile)
+{
+	FILE* pf = fopen(pidfile, "w");
+	fprintf(pf, "%d", ippool_my_pid);
+	fclose(pf);
+}
+
 static void ippool_cleanup(void)
 {
 	pid_t pid;
diff -urN ippool-1.3/Makefile ippool-1.3.patched/Makefile
--- ippool-1.3/Makefile	2008-02-24 11:22:25.000000000 -0500
+++ ippool-1.3.patched/Makefile	2013-08-20 17:07:55.327868764 -0400
@@ -15,7 +15,7 @@
 # Points to pppd install. 
 # By default, pppd headers are assumed to be in /usr/include/pppd. but 
 # can be pointed to a local pppd source tree if desired.
-PPPD_VERSION=		2.4.4
+PPPD_VERSION=		2.4.5
 # PPPD_SRCDIR=		/usr/local/src/ppp-2.4.4
 # PPPD_LIBDIR=		/usr/lib/pppd/2.4.4
 
@@ -23,6 +23,7 @@
 # If not defined, readline is assumed to be installed in the standard places that
 # the compiler looks.
 READLINE_DIR=		
+DESTDIR=/opt/ippool
 
 # For cross-compiling
 CROSS_COMPILE=
@@ -81,8 +82,8 @@
 export USE_DMALLOC
 endif
 
-CPPFLAGS=		$(CPPFLAGS.ippooltest)
-CFLAGS=			-I. -Iusl -Icli -MMD -Wall -g $(CPPFLAGS) $(CPPFLAGS.dmalloc)
+CPPFLAGS=		$(CPPFLAGS.ippooltest) -fPIC
+CFLAGS=			-I. -Iusl -Icli -MMD -Wall -g $(CPPFLAGS) $(CPPFLAGS.dmalloc) -fPIC
 LDFLAGS.ippoold=	-Wl,-E -L. -Lusl -lusl -lnsl -ldl $(LIBS.dmalloc) -lc
 LDFLAGS.ippoolconfig=	-Lcli -lcli -lreadline -lcurses -lnsl $(LIBS.dmalloc) -lc
 
diff -urN ippool-1.3/pppd/Makefile ippool-1.3.patched/pppd/Makefile
--- ippool-1.3/pppd/Makefile	2008-02-03 10:46:58.000000000 -0500
+++ ippool-1.3.patched/pppd/Makefile	2013-08-20 17:07:55.327868764 -0400
@@ -10,7 +10,7 @@
 
 # END CONFIGURABLE SETTINGS
 
-CFLAGS	+= -g -I.. -I/usr/include/pppd $(CFLAGS.pppd) -fPIC
+CFLAGS	+= -g -I.. -I/root/rpmbuild/BUILD/ppp-2.4.5/pppd $(CFLAGS.pppd) -fPIC
 LDFLAGS	+= -shared
 
 all:	ippool.so
diff -urN ippool-1.3/usl/usl_timer.c ippool-1.3.patched/usl/usl_timer.c
--- ippool-1.3/usl/usl_timer.c	2008-02-03 09:55:30.000000000 -0500
+++ ippool-1.3.patched/usl/usl_timer.c	2013-08-20 17:07:55.327868764 -0400
@@ -29,6 +29,7 @@
  */
 
 #include <stdio.h>
+#include <limits.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/types.h>
