summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2014-06-24 14:28:51 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-07-16 17:12:02 +0200
commit3e57c78c8163f6ee395bdf34b1e2c550cd8467f1 (patch)
treeef6c2bfe870b4b30414674a9a5fde0b0382cc725
parent727f4bf4829f2405c978a4c9b960bef3ad86b002 (diff)
downloadsssd-3e57c78c8163f6ee395bdf34b1e2c550cd8467f1.tar.gz
sssd-3e57c78c8163f6ee395bdf34b1e2c550cd8467f1.tar.xz
sssd-3e57c78c8163f6ee395bdf34b1e2c550cd8467f1.zip
IFP: Return a specific value on failure connecting to the system bus
We need to treat the failure to connect to the system bus as non-fatal. In this commit, we introduce a special error code and only print a DEBUG message when this error code is returned from the startup function. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
-rw-r--r--src/responder/ifp/ifpsrv.c8
-rw-r--r--src/util/util_errors.c1
-rw-r--r--src/util/util_errors.h1
3 files changed, 8 insertions, 2 deletions
diff --git a/src/responder/ifp/ifpsrv.c b/src/responder/ifp/ifpsrv.c
index 35bcc910e..0815d6cc0 100644
--- a/src/responder/ifp/ifpsrv.c
+++ b/src/responder/ifp/ifpsrv.c
@@ -134,7 +134,7 @@ sysbus_init(TALLOC_CTX *mem_ctx,
DEBUG(SSSDBG_CRIT_FAILURE,
"Failed to connect to D-BUS system bus: [%s]\n",
dbus_error.message);
- ret = EIO;
+ ret = ERR_NO_SYSBUS;
goto fail;
}
dbus_connection_set_exit_on_disconnect(conn, FALSE);
@@ -313,7 +313,11 @@ int ifp_process_init(TALLOC_CTX *mem_ctx,
INFOPIPE_PATH,
&ifp_iface.vtable,
ifp_ctx, &ifp_ctx->sysbus);
- if (ret != EOK) {
+ if (ret == ERR_NO_SYSBUS) {
+ DEBUG(SSSDBG_MINOR_FAILURE,
+ "The system bus is not available..\n");
+ /* Explicitly ignore, the D-Bus daemon will start us */
+ } else if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE,
"Failed to connect to the system message bus\n");
talloc_free(ifp_ctx);
diff --git a/src/util/util_errors.c b/src/util/util_errors.c
index 90faa3e42..0306be35d 100644
--- a/src/util/util_errors.c
+++ b/src/util/util_errors.c
@@ -58,6 +58,7 @@ struct err_string error_to_str[] = {
{ "Malformed extra attribute" }, /* ERR_INVALID_EXTRA_ATTR */
{ "Cannot get bus message sender" }, /* ERR_SBUS_GET_SENDER_ERROR */
{ "Bus message has no sender" }, /* ERR_SBUS_NO_SENDER */
+ { "Cannot connect to system bus" }, /* ERR_NO_SYSBUS */
};
diff --git a/src/util/util_errors.h b/src/util/util_errors.h
index 4d9f16c0a..701409240 100644
--- a/src/util/util_errors.h
+++ b/src/util/util_errors.h
@@ -80,6 +80,7 @@ enum sssd_errors {
ERR_INVALID_EXTRA_ATTR,
ERR_SBUS_GET_SENDER_ERROR,
ERR_SBUS_NO_SENDER,
+ ERR_NO_SYSBUS,
ERR_LAST /* ALWAYS LAST */
};