--- a/configure.ac +++ b/configure.ac @@ -116,7 +116,15 @@ AC_SEARCH_LIBS([cap_init], [cap]) PKG_CHECK_MODULES(DBUS, dbus-1) -PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd) + +AC_ARG_ENABLE(systemd-integration, + AS_HELP_STRING([--enable-systemd-integration], [use the sd-daemon API to communicate with systemd]), + [enable_libsystemd=$enableval], + [enable_libsystemd=yes]) +if test "x${enable_libsystemd}" != "xno"; then + PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd) + AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define to 1 if you have libsystemd and its header files]) +fi AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), @@ -142,5 +150,6 @@ localstatedir: ${localstatedir} Compiler: ${CC} CFLAGS: ${CFLAGS} + systemd integration: ${enable_libsystemd} systemd unit directory: ${systemdsystemunitdir} " --- a/rtkit-daemon.c +++ b/rtkit-daemon.c @@ -50,7 +50,10 @@ #include #include #include + +#ifdef HAVE_LIBSYSTEMD #include +#endif #include "rtkit.h" @@ -1432,11 +1435,13 @@ n_total_processes, n_users); +#ifdef HAVE_LIBSYSTEMD sd_notifyf(0, "STATUS=Supervising %u threads of %u processes of %u users.", n_total_threads, n_total_processes, n_users); +#endif finish: if (r) { @@ -2304,7 +2309,9 @@ syslog(LOG_DEBUG, "Running.\n"); +#ifdef HAVE_LIBSYSTEMD sd_notify(0, "STATUS=Running."); +#endif dbus_connection_set_exit_on_disconnect(bus, FALSE);