summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2017-06-20 13:08:06 +0100
committerSimon McVittie <smcv@collabora.com>2017-06-30 10:51:14 +0100
commit1477ca50354a313805690f6c9e581e9d26acefe0 (patch)
tree43c7f41282c63d1468892d6e230b75d8bb308a7d /configure.ac
parent1cd79d185a4b1582f5fd71d2ff7f292b1202519e (diff)
downloaddbus-1477ca50354a313805690f6c9e581e9d26acefe0.tar.gz
build: Introduce ${runstatedir} and use it for the pid file
By default ${runstatedir} is the same as ${localstatedir}/run, but many Linux distributions configure it to be /run and mount a tmpfs in that location. All other factors being equal, it is preferable to use /run where available because it is guaranteed to be local, whereas traversing /var might involve automounting a networked filesystem (even though /var/run itself is very likely to be a tmpfs). /run or /var/run is currently only used in a few places in dbus, but I plan to make more use of it during the development of <https://bugs.freedesktop.org/show_bug.cgi?id=100344>. The pid file is not part of the API between dbus and other software (other than distribution init scripts for dbus itself), so we do not need to keep it strictly compatible; so it is OK to move it. We do not yet use /run for the system bus socket, because that is part of the API between D-Bus clients and servers, and has always been "officially" /var/run/dbus/system_bus_socket. <https://bugs.freedesktop.org/show_bug.cgi?id=101628> tracks the possibility of changing that. Similarly, we do not replace /var/run/console with /run/console, because that path is part of the API between dbus-daemon and the obsolete PAM modules pam_console and pam_foreground that used /var/run/console. <https://bugs.freedesktop.org/show_bug.cgi?id=101629> tracks the possible future removal of that code path. In the CMake build system, the equivalent of ${runstatedir} remains hard-coded to the equivalent of ${localstatedir}/run for simplicity. For the sort of system-wide installations that would consider redefining ${runstatedir} to /run, the Autotools build system is strongly recommended: in particular this is what Linux distributions are expected to use. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101569
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac16
1 files changed, 14 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 4dcbf465..53c8b348 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1486,6 +1486,11 @@ AM_CONDITIONAL(DBUS_CAN_UPLOAD_DOCS,
[test x$enable_doxygen_docs = xyes && test x$enable_xml_docs = xyes &&
test x$enable_ducktype_docs = xyes])
+# Autoconf 2.70 will support this, and many distros patch this option in,
+# but Autoconf 2.70 hasn't actually been released yet.
+AS_IF([test -z "${runstatedir}"], [runstatedir='${localstatedir}/run'])
+AC_SUBST([runstatedir])
+
#### Have to go $localstatedir->$prefix/var->/usr/local/var
#### find the actual value for $prefix that we'll end up with
@@ -1498,6 +1503,7 @@ AS_AC_EXPAND(EXPANDED_BINDIR, "$bindir")
AS_AC_EXPAND(EXPANDED_LIBDIR, "$libdir")
AS_AC_EXPAND(EXPANDED_LIBEXECDIR, "$libexecdir")
AS_AC_EXPAND(EXPANDED_DATADIR, "$datadir")
+AS_AC_EXPAND(EXPANDED_RUNSTATEDIR, "$runstatedir")
#### Check our operating system
operating_system=unknown
@@ -1556,6 +1562,9 @@ AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])
if ! test -z "$with_system_socket"; then
DBUS_SYSTEM_SOCKET=$with_system_socket
else
+ # We don't use runstatedir for this (yet?), because /var/run has been the
+ # interoperable system bus socket for 10+ years.
+ # See https://bugs.freedesktop.org/show_bug.cgi?id=101628
DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
fi
@@ -1581,9 +1590,9 @@ AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS, "$DBUS_SYSTEM_BUS_DEFAULT_AD
if ! test -z "$with_system_pid_file"; then
DBUS_SYSTEM_PID_FILE=$with_system_pid_file
elif test x$with_init_scripts = xredhat ; then
- DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
+ DBUS_SYSTEM_PID_FILE="${EXPANDED_RUNSTATEDIR}/messagebus.pid"
else
- DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
+ DBUS_SYSTEM_PID_FILE="${EXPANDED_RUNSTATEDIR}/dbus/pid"
fi
AC_SUBST(DBUS_SYSTEM_PID_FILE)
@@ -1592,6 +1601,8 @@ AC_SUBST(DBUS_SYSTEM_PID_FILE)
if ! test -z "$with_console_auth_dir"; then
DBUS_CONSOLE_AUTH_DIR=$with_console_auth_dir
else
+ # We don't use runstatedir for this, because /var/run is the
+ # path that was traditionally used by pam_console and pam_foreground.
DBUS_CONSOLE_AUTH_DIR=/var/run/console/
fi
@@ -1919,6 +1930,7 @@ echo "
bindir: ${EXPANDED_BINDIR}
sysconfdir: ${EXPANDED_SYSCONFDIR}
localstatedir: ${EXPANDED_LOCALSTATEDIR}
+ runstatedir: ${EXPANDED_RUNSTATEDIR}
datadir: ${EXPANDED_DATADIR}
source code location: ${srcdir}
compiler: ${CC}