6657fd
diff -up rpcbind-0.2.4/src/rpcbind.c.orig rpcbind-0.2.4/src/rpcbind.c
6657fd
--- rpcbind-0.2.4/src/rpcbind.c.orig	2017-03-21 10:12:35.005190509 -0400
6657fd
+++ rpcbind-0.2.4/src/rpcbind.c	2017-03-21 10:36:45.510507649 -0400
6657fd
@@ -144,6 +144,8 @@ static void rbllist_add(rpcprog_t, rpcve
6657fd
 static void terminate(int);
6657fd
 static void parseargs(int, char *[]);
6657fd
 
6657fd
+char *systemdtmp = "/usr/bin/systemd-tmpfiles --create rpcbind.conf";
6657fd
+
6657fd
 int
6657fd
 main(int argc, char *argv[])
6657fd
 {
6657fd
@@ -151,13 +153,21 @@ main(int argc, char *argv[])
6657fd
 	void *nc_handle;	/* Net config handle */
6657fd
 	struct rlimit rl;
6657fd
 	int maxrec = RPC_MAXDATASIZE;
6657fd
+	int once = 1;
6657fd
 
6657fd
 	parseargs(argc, argv);
6657fd
 
6657fd
+tryagain:
6657fd
 	/* Check that another rpcbind isn't already running. */
6657fd
 	if ((rpcbindlockfd = (open(RPCBINDDLOCK,
6657fd
-	    O_RDONLY|O_CREAT, 0444))) == -1)
6657fd
+	    O_RDONLY|O_CREAT, 0444))) == -1) {
6657fd
+		if (once) {
6657fd
+			once = system(systemdtmp); /* set once to avoid a warning */
6657fd
+			once = 0;
6657fd
+			goto tryagain; 
6657fd
+		}
6657fd
 		err(1, "%s", RPCBINDDLOCK);
6657fd
+	}
6657fd
 
6657fd
 	if(flock(rpcbindlockfd, LOCK_EX|LOCK_NB) == -1 && errno == EWOULDBLOCK)
6657fd
 		errx(1, "another rpcbind is already running. Aborting");