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