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