summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/monitor.c8
-rw-r--r--server/providers/data_provider.c16
-rw-r--r--server/providers/data_provider_be.c27
-rw-r--r--server/sbus_interfaces.h4
4 files changed, 34 insertions, 21 deletions
diff --git a/server/monitor.c b/server/monitor.c
index 3dc76061..2297957e 100644
--- a/server/monitor.c
+++ b/server/monitor.c
@@ -626,6 +626,8 @@ static int service_send_ping(struct mt_svc *svc)
return ENXIO;
}
+ DEBUG(4,("Pinging %s\n", svc->name));
+
conn = sbus_get_connection(svc->mt_conn->conn_ctx);
dbus_error_init(&dbus_error);
@@ -697,6 +699,8 @@ static void ping_check(DBusPendingCall *pending, void *data)
/* ok peer replied,
* set the reply timestamp into the service structure */
+ DEBUG(4,("Service %s replied to ping\n", svc->name));
+
svc->last_pong = time(NULL);
break;
@@ -735,6 +739,8 @@ static int service_check_alive(struct mt_svc *svc)
int status;
pid_t pid;
+ DEBUG(4,("Checking service %s(%d) is still alive\n", svc->name, svc->pid));
+
pid = waitpid(svc->pid, &status, WNOHANG);
if (pid == 0) {
return EOK;
@@ -861,6 +867,8 @@ static int start_service(const char *name, const char *command, pid_t *retpid)
char **args;
pid_t pid;
+ DEBUG(4,("Starting service %s\n", name));
+
pid = fork();
if (pid != 0) {
if (pid == -1) {
diff --git a/server/providers/data_provider.c b/server/providers/data_provider.c
index cc63b045..823054ab 100644
--- a/server/providers/data_provider.c
+++ b/server/providers/data_provider.c
@@ -191,8 +191,8 @@ static int dp_db_init(struct dp_ctx *dpctx)
return EOK;
}
-static void identity_check(DBusPendingCall *pending, void *data);
-static void online_check(DBusPendingCall *pending, void *data);
+static void be_identity_check(DBusPendingCall *pending, void *data);
+static void be_online_check(DBusPendingCall *pending, void *data);
static int dbus_dp_init(struct sbus_conn_ctx *conn_ctx, void *data)
{
@@ -249,13 +249,13 @@ static int dbus_dp_init(struct sbus_conn_ctx *conn_ctx, void *data)
}
/* Set up the reply handler */
- dbus_pending_call_set_notify(pending_reply, identity_check, dpcli, NULL);
+ dbus_pending_call_set_notify(pending_reply, be_identity_check, dpcli, NULL);
dbus_message_unref(msg);
return EOK;
}
-static void identity_check(DBusPendingCall *pending, void *data)
+static void be_identity_check(DBusPendingCall *pending, void *data)
{
struct dp_backend *dpbe;
struct dp_frontend *dpfe;
@@ -297,7 +297,7 @@ static void identity_check(DBusPendingCall *pending, void *data)
DBUS_TYPE_STRING, &cli_domain,
DBUS_TYPE_INVALID);
if (!ret) {
- DEBUG(1,("Failed, to parse message, killing connection\n"));
+ DEBUG(1,("be_identity_check failed, to parse message, killing connection\n"));
sbus_disconnect(dpcli->conn_ctx);
goto done;
}
@@ -377,7 +377,7 @@ done:
dbus_message_unref(reply);
}
-static void online_check(DBusPendingCall *pending, void *data)
+static void be_online_check(DBusPendingCall *pending, void *data)
{
return;
}
@@ -438,12 +438,12 @@ static int dp_srv_init(struct dp_ctx *dpctx)
}
/* Set up globally-available D-BUS methods */
- sd_ctx->interface = talloc_strdup(sd_ctx, DATA_PROVIDER_DBUS_INTERFACE);
+ sd_ctx->interface = talloc_strdup(sd_ctx, DATA_PROVIDER_INTERFACE);
if (!sd_ctx->interface) {
ret = ENOMEM;
goto done;
}
- sd_ctx->path = talloc_strdup(sd_ctx, DATA_PROVIDER_DBUS_PATH);
+ sd_ctx->path = talloc_strdup(sd_ctx, DATA_PROVIDER_PATH);
if (!sd_ctx->path) {
ret = ENOMEM;
goto done;
diff --git a/server/providers/data_provider_be.c b/server/providers/data_provider_be.c
index 982978aa..060b4e7a 100644
--- a/server/providers/data_provider_be.c
+++ b/server/providers/data_provider_be.c
@@ -66,11 +66,11 @@ struct sbus_method mon_sbus_methods[] = {
};
static int be_identity(DBusMessage *message, void *data, DBusMessage **r);
-static int check_online(DBusMessage *message, void *data, DBusMessage **r);
+static int be_check_online(DBusMessage *message, void *data, DBusMessage **r);
struct sbus_method be_methods[] = {
{ DP_CLI_METHOD_IDENTITY, be_identity },
- { DP_CLI_METHOD_ONLINE, check_online },
+ { DP_CLI_METHOD_ONLINE, be_check_online },
{ NULL, NULL }
};
@@ -91,6 +91,8 @@ static int service_identity(DBusMessage *message, void *data, DBusMessage **r)
ctx = talloc_get_type(user_data, struct be_ctx);
if (!ctx) return EINVAL;
+ DEBUG(4,("Sending ID reply: (%s,%d)\n", ctx->identity, version));
+
reply = dbus_message_new_method_return(message);
ret = dbus_message_append_args(reply,
DBUS_TYPE_STRING, &ctx->identity,
@@ -137,6 +139,9 @@ static int be_identity(DBusMessage *message, void *data, DBusMessage **r)
ctx = talloc_get_type(user_data, struct be_ctx);
if (!ctx) return EINVAL;
+ DEBUG(4,("Sending ID reply: (%d,%d,%s,%s)\n",
+ clitype, version, ctx->name, ctx->domain));
+
reply = dbus_message_new_method_return(message);
ret = dbus_message_append_args(reply,
DBUS_TYPE_UINT16, &clitype,
@@ -152,7 +157,7 @@ static int be_identity(DBusMessage *message, void *data, DBusMessage **r)
return EOK;
}
-static int check_online(DBusMessage *message, void *data, DBusMessage **r)
+static int be_check_online(DBusMessage *message, void *data, DBusMessage **r)
{
struct sbus_message_handler_ctx *smh_ctx;
struct be_ctx *ctx;
@@ -215,7 +220,7 @@ static int be_dp_sbus_init(TALLOC_CTX *mem_ctx,
struct service_sbus_ctx *ss_ctx;
struct sbus_method_ctx *sm_ctx;
TALLOC_CTX *tmp_ctx;
- char *default_monitor_address;
+ char *default_dp_address;
char *sbus_address;
DBusConnection *conn;
int ret;
@@ -233,16 +238,16 @@ static int be_dp_sbus_init(TALLOC_CTX *mem_ctx,
}
ss_ctx->ev = ev;
- default_monitor_address = talloc_asprintf(tmp_ctx, "unix:path=%s/%s",
- PIPE_PATH, SSSD_SERVICE_PIPE);
- if (default_monitor_address == NULL) {
+ default_dp_address = talloc_asprintf(tmp_ctx, "unix:path=%s/%s",
+ PIPE_PATH, DATA_PROVIDER_PIPE);
+ if (default_dp_address == NULL) {
ret = ENOMEM;
goto done;
}
ret = confdb_get_string(cdb, tmp_ctx,
- "config/services/monitor", "sbusAddress",
- default_monitor_address, &sbus_address);
+ "config/services/dp", "sbusAddress",
+ default_dp_address, &sbus_address);
if (ret != EOK) goto done;
ret = sbus_new_connection(ss_ctx, ss_ctx->ev,
@@ -259,8 +264,8 @@ static int be_dp_sbus_init(TALLOC_CTX *mem_ctx,
goto done;
}
- sm_ctx->interface = talloc_strdup(sm_ctx, SERVICE_INTERFACE);
- sm_ctx->path = talloc_strdup(sm_ctx, SERVICE_PATH);
+ sm_ctx->interface = talloc_strdup(sm_ctx, DATA_PROVIDER_INTERFACE);
+ sm_ctx->path = talloc_strdup(sm_ctx, DATA_PROVIDER_PATH);
if (!sm_ctx->interface || !sm_ctx->path) {
ret = ENOMEM;
goto done;
diff --git a/server/sbus_interfaces.h b/server/sbus_interfaces.h
index 455aaad2..58a85749 100644
--- a/server/sbus_interfaces.h
+++ b/server/sbus_interfaces.h
@@ -42,7 +42,7 @@
/* Data Provider */
-#define DATA_PROVIDER_DBUS_INTERFACE "org.freeipa.sssd.dataprovider"
-#define DATA_PROVIDER_DBUS_PATH "/org/freeipa/sssd/dataprovider"
+#define DATA_PROVIDER_INTERFACE "org.freeipa.sssd.dataprovider"
+#define DATA_PROVIDER_PATH "/org/freeipa/sssd/dataprovider"
#define DP_METHOD_CHECK_ONLINE "isOnline"