From a7d1bc8dcb96df5afd8f3e594f10f95ef0f1cfef Mon Sep 17 00:00:00 2001 From: Benjamin Reed Date: Sat, 26 Jan 2008 14:33:51 -0500 Subject: [PATCH] Add a LaunchAgent file for launchd Add a file which tells launchd how to auto-launch the dbus session daemon. Also, add --with-launchd-agent-dir to allow overriding of the default /Library/LaunchAgents location. --- bus/Makefile.am | 8 +++++++- bus/org.freedesktop.dbus-session.plist.in | 27 +++++++++++++++++++++++++++ configure.in | 12 ++++++++++++ 3 files changed, 46 insertions(+), 1 deletions(-) create mode 100644 bus/org.freedesktop.dbus-session.plist.in diff --git a/bus/Makefile.am b/bus/Makefile.am index 3b4f69d..420742b 100644 --- a/bus/Makefile.am +++ b/bus/Makefile.am @@ -9,12 +9,18 @@ EFENCE= CONFIG_IN_FILES= \ session.conf.in \ - system.conf.in + system.conf.in \ + org.freedesktop.dbus-session.plist.in config_DATA= \ session.conf \ system.conf +if DBUS_ENABLE_LAUNCHD +agentdir=$(LAUNCHD_AGENT_DIR) +agent_DATA=org.freedesktop.dbus-session.plist +endif + if DBUS_USE_LIBXML XML_SOURCES=config-loader-libxml.c endif diff --git a/bus/org.freedesktop.dbus-session.plist.in b/bus/org.freedesktop.dbus-session.plist.in new file mode 100644 index 0000000..bcaafe8 --- /dev/null +++ b/bus/org.freedesktop.dbus-session.plist.in @@ -0,0 +1,27 @@ + + + + + Label + org.freedesktop.dbus-session + + ServiceIPC + + + ProgramArguments + + @DBUS_DAEMONDIR@/dbus-daemon + --nofork + --session + + + Sockets + + session + + SecureSocketWithKey + DBUS_LAUNCHD_SESSION_BUS_SOCKET + + + + diff --git a/configure.in b/configure.in index 776d196..f6dd79f 100644 --- a/configure.in +++ b/configure.in @@ -87,6 +87,7 @@ AC_ARG_WITH(system-pid-file, AS_HELP_STRING([--with-system-pid-file=[pidfile]],[ AC_ARG_WITH(system-socket, AS_HELP_STRING([--with-system-socket=[filename]],[UNIX domain socket for systemwide daemon])) AC_ARG_WITH(console-auth-dir, AS_HELP_STRING([--with-console-auth-dir=[dirname]],[directory to check for console ownerhip])) AC_ARG_WITH(console-owner-file, AS_HELP_STRING([--with-console-owner-file=[filename]],[file whose owner determines current console owner])) +AC_ARG_WITH(launchd-agent-dir, AS_HELP_STRING([--with-launchd-agent-dir=[dirname]],[directory to put the launchd agent (default: /Library/LaunchAgents)])) AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=],[User for running the DBUS daemon (messagebus)])) AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Directory for installing the DBUS daemon])) @@ -977,6 +978,15 @@ fi AM_CONDITIONAL(DBUS_ENABLE_LAUNCHD, test x$have_launchd = xyes) +#### Directory to place launchd agent file +if ! test -z "$with_launchd_agent_dir"; then + LAUNCHD_AGENT_DIR="$with_launchd_agent_dir" +else + LAUNCHD_AGENT_DIR="/Library/LaunchAgents" +fi + +AC_SUBST(LAUNCHD_AGENT_DIR) + dnl console owner file if test x$enable_console_owner_file = xno ; then have_console_owner_file=no; @@ -1326,6 +1336,7 @@ dbus/dbus-arch-deps.h bus/system.conf bus/session.conf bus/messagebus +bus/org.freedesktop.dbus-session.plist bus/rc.messagebus bus/dbus-daemon.1 Makefile @@ -1407,6 +1418,7 @@ echo " System bus user: ${DBUS_USER} Session bus services dir: ${EXPANDED_DATADIR}/dbus-1/services 'make check' socket dir: ${TEST_SOCKET_DIR} + launchd agent dir: ${LAUNCHD_AGENT_DIR} " if test x$enable_tests = xyes; then -- 1.5.3.7