[RFC PATCH xserver] os: move tempfiles.d/x11.conf from systemd to here

Peter Hutterer peter.hutterer at who-t.net
Thu Nov 9 04:19:21 UTC 2017


Let's not rely on some other package to set up and clean up after our
tempfiles.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
Not all of these are created by the server, but moving them to the
respective libs etc. makes even less sense.

 configure.ac   | 13 +++++++++++++
 os/Makefile.am |  7 ++++++-
 os/x11.conf    | 11 +++++++++++
 3 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 os/x11.conf

diff --git a/configure.ac b/configure.ac
index ec98f52c0..54d71bbbe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -851,6 +851,19 @@ if test "x$WITH_SYSTEMD_DAEMON" = "xyes" -o "x$WITH_SYSTEMD_DAEMON" = "xauto" ;
 fi
 AM_CONDITIONAL([HAVE_SYSTEMD_DAEMON], [test "x$HAVE_SYSTEMD_DAEMON" = "xyes"])
 
+dnl systemd tmpfiles.d directory
+PKG_CHECK_MODULES([SYSTEMD], [systemd],
+                  [tmpfilesdir=`$PKG_CONFIG --variable=tmpfilesdir systemd`],
+                  [tmpfilesdir=no])
+AC_ARG_WITH([tmpfiles-dir],
+            AS_HELP_STRING([--with-tmpfiles-dir],
+                           [Install the tmpfiles into the given directory (default: auto)]),
+            [TMPFILES_DIR=$withval], [TMPFILES_DIR=$tmpfilesdir])
+if test "x$TMPFILES_DIR" != "xno"; then
+	AC_SUBST(TMPFILES_DIR, "$TMPFILES_DIR")
+fi
+AM_CONDITIONAL(HAVE_TMPFILES_DIR, test "x$TMPFILES_DIR" != "xno")
+
 if test "x$CONFIG_UDEV" = xyes && test "x$CONFIG_HAL" = xyes; then
 	AC_MSG_ERROR([Hotplugging through both libudev and hal not allowed])
 fi
diff --git a/os/Makefile.am b/os/Makefile.am
index c6e78cb99..437e91431 100644
--- a/os/Makefile.am
+++ b/os/Makefile.am
@@ -54,7 +54,12 @@ if BUSFAULT
 libos_la_SOURCES += $(BUSFAULT_SRCS)
 endif
 
-EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS)
+if HAVE_TMPFILES_DIR
+tmpfilesdir = $(TMPFILES_DIR)
+tmpfiles_DATA = x11.conf
+endif
+
+EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS) x11.conf
 
 if SPECIAL_DTRACE_OBJECTS
 # Generate dtrace object code for probes in libos & libdix
diff --git a/os/x11.conf b/os/x11.conf
new file mode 100644
index 000000000..eb2d67d72
--- /dev/null
+++ b/os/x11.conf
@@ -0,0 +1,11 @@
+# See tmpfiles.d(5) for details
+
+# Make sure these are created by default so that nobody else can
+d /tmp/.X11-unix 1777 root root 10d
+d /tmp/.ICE-unix 1777 root root 10d
+d /tmp/.XIM-unix 1777 root root 10d
+d /tmp/.font-unix 1777 root root 10d
+d /tmp/.Test-unix 1777 root root 10d
+
+# Unlink the X11 lock files
+r! /tmp/.X[0-9]*-lock
-- 
2.13.6



More information about the xorg-devel mailing list