summaryrefslogtreecommitdiffstats
path: root/server/monitor.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-11-03 17:18:49 -0500
committerSimo Sorce <idra@samba.org>2008-11-03 17:18:49 -0500
commita2c6e0e0beb75e0a8fa7e3e07e9443d97ea2b731 (patch)
treec59aa17b7b63327d1a63561586ab7ba4ea70edf0 /server/monitor.c
parentddbc682f58bcee78ac1dbd24b3c44da67512d888 (diff)
downloadsssd-a2c6e0e0beb75e0a8fa7e3e07e9443d97ea2b731.tar.gz
sssd-a2c6e0e0beb75e0a8fa7e3e07e9443d97ea2b731.tar.xz
sssd-a2c6e0e0beb75e0a8fa7e3e07e9443d97ea2b731.zip
Add support for dbus comunication in the nss service
Add utility function in confdb Make all component fetch the dbus socket from the confdb
Diffstat (limited to 'server/monitor.c')
-rw-r--r--server/monitor.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/server/monitor.c b/server/monitor.c
index f7ba80098..5574d70c8 100644
--- a/server/monitor.c
+++ b/server/monitor.c
@@ -32,9 +32,6 @@
#include "sbus/sssd_dbus.h"
#include "sbus_interfaces.h"
-/* TODO: get this value from LDB */
-#define DBUS_ADDRESS "unix:path=/var/lib/sss/pipes/private/dbus"
-
struct mt_ctx {
struct event_context *ev;
struct confdb_ctx *cdb;
@@ -84,8 +81,16 @@ struct sbus_method monitor_methods[] = {
static int monitor_dbus_init(struct mt_ctx *ctx)
{
struct sbus_method_ctx *sd_ctx;
+ char *sbus_address;
int ret;
+ ret = confdb_get_string(ctx->cdb, ctx,
+ "config.services.monitor", "sbusAddress",
+ DEFAULT_SBUS_ADDRESS, &sbus_address);
+ if (ret != EOK) {
+ return ret;
+ }
+
sd_ctx = talloc_zero(ctx, struct sbus_method_ctx);
if (!sd_ctx) {
return ENOMEM;
@@ -105,7 +110,7 @@ static int monitor_dbus_init(struct mt_ctx *ctx)
sd_ctx->methods = monitor_methods;
sd_ctx->message_handler = NULL; /* Use the default message_handler */
- ret = sbus_new_server(ctx->ev, sd_ctx, DBUS_ADDRESS, dbus_service_init);
+ ret = sbus_new_server(ctx->ev, sd_ctx, sbus_address, dbus_service_init);
return ret;
}