Blob Blame History Raw
commit b47e0f12cfa005bb120e018257410663efbd7254
Author: Steve Dickson <steved@redhat.com>
Date:   Tue Nov 15 13:32:40 2016 -0500

    Use systemd-tmpfiles to create the warmstart directory
    
    When systemd is available have it create the /run/rpcbind
    warmstart directory. Note, the new rpcbind.conf file
    expects 'rpc' user and group since that those will be
    the id/gid that will own the directory.
    
    Signed-off-by: Steve Dickson <steved@redhat.com>

diff --git a/Makefile.am b/Makefile.am
index 43c2710..d7ca426 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -54,6 +54,9 @@ rpcbind_LDADD += $(SYSTEMD_LIBS)
 systemdsystemunit_DATA = \
 	systemd/rpcbind.service \
 	systemd/rpcbind.socket
+
+systemdtmpfiles_DATA = \
+	systemd/rpcbind.conf
 endif
 
 rpcinfo_SOURCES =       src/rpcinfo.c
diff --git a/configure.ac b/configure.ac
index acc6914..81adafc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,6 +52,17 @@ AC_ARG_WITH([systemdsystemunitdir],
   fi
 AM_CONDITIONAL(SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
 
+AC_ARG_WITH([systemdtmpfilesdir],
+  AS_HELP_STRING([--with-systemdtmpfilesdir=DIR], [Directory for systemd tmp files]),
+  [], [with_systemdtmpfilesdir=$($PKG_CONFIG --variable=tmpfilesdir systemd)])
+  if test "x$with_systemdtmpfilesdir" != xno; then
+    AC_SUBST([systemdtmpfilesdir], [$with_systemdtmpfilesdir])
+     PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [],
+	   [PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon], [],
+	   AC_MSG_ERROR([libsystemd support requested but found]))])
+  fi
+AM_CONDITIONAL(SYSTEMD, [test -n "$with_systemdtmpfilesdir" -a "x$with_systemdtmpfilesdir" != xno ])
+
 AS_IF([test x$enable_libwrap = xyes], [
 	AC_CHECK_LIB([wrap], [hosts_access], ,
 		AC_MSG_ERROR([libwrap support requested but unable to find libwrap]))
diff --git a/systemd/rpcbind.conf b/systemd/rpcbind.conf
new file mode 100644
index 0000000..2f8af45
--- /dev/null
+++ b/systemd/rpcbind.conf
@@ -0,0 +1,2 @@
+#Type Path         Mode  UID  GID Age Argument
+D     /run/rpcbind 0700  rpc  rpc  -  -