summaryrefslogtreecommitdiffstats
path: root/src/monitor
diff options
context:
space:
mode:
authorJustin Stephenson <jstephen@redhat.com>2016-08-26 17:43:25 -0400
committerJakub Hrozek <jhrozek@redhat.com>2016-09-12 10:23:41 +0200
commit081c6d8c7c8e75487d1c4e42862964be1e85b575 (patch)
tree552c099c5a4dca4cd49aefab5dd6e9b14bff64b1 /src/monitor
parent632fc5d8991d167eea20769c823163551c3f1d8c (diff)
downloadsssd-081c6d8c7c8e75487d1c4e42862964be1e85b575.tar.gz
sssd-081c6d8c7c8e75487d1c4e42862964be1e85b575.tar.xz
sssd-081c6d8c7c8e75487d1c4e42862964be1e85b575.zip
MONITOR: Add disable_netlink option
Adding a new monitor boolean option to disable netlink support. This will give users more control over sssd state changes without having to modify systemd unit files. Resolves: https://fedorahosted.org/sssd/ticket/3142 Reviewed-by: Petr Cech <pcech@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/monitor')
-rw-r--r--src/monitor/monitor.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 442bdbc42..84a144e56 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -2052,6 +2052,7 @@ static int monitor_process_init(struct mt_ctx *ctx,
int num_providers;
int ret;
int error;
+ bool disable_netlink;
struct sysdb_upgrade_ctx db_up_ctx;
/* Set up the environment variable for the Kerberos Replay Cache */
@@ -2172,14 +2173,28 @@ static int monitor_process_init(struct mt_ctx *ctx,
return ret;
}
- ret = setup_netlink(ctx, ctx->ev, network_status_change_cb,
- ctx, &ctx->nlctx);
+ ret = confdb_get_bool(ctx->cdb,
+ CONFDB_MONITOR_CONF_ENTRY,
+ CONFDB_MONITOR_DISABLE_NETLINK,
+ false, &disable_netlink);
+
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE,
- "Cannot set up listening for network notifications\n");
+ "Failed to read disable_netlink from confdb: [%d] %s\n",
+ ret, sss_strerror(ret));
return ret;
}
+ if (disable_netlink == false) {
+ ret = setup_netlink(ctx, ctx->ev, network_status_change_cb,
+ ctx, &ctx->nlctx);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_OP_FAILURE,
+ "Cannot set up listening for network notifications\n");
+ return ret;
+ }
+ }
+
/* start providers */
num_providers = 0;
for (dom = ctx->domains; dom; dom = get_next_domain(dom, 0)) {