1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
--- 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 <dirent.h>
#include <syslog.h>
#include <grp.h>
+
+#ifdef HAVE_LIBSYSTEMD
#include <systemd/sd-daemon.h>
+#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);
|