summaryrefslogtreecommitdiffstats
path: root/src/monitor
diff options
context:
space:
mode:
authorJustin Stephenson <jstephen@redhat.com>2016-08-12 10:55:04 -0400
committerLukas Slebodnik <lslebodn@redhat.com>2016-08-17 17:20:49 +0200
commit7c475c3a02329f477f6245cce40d70615e616e85 (patch)
tree46fe826e92a2ed93f7b3f65f9d8860fae80ce2f2 /src/monitor
parent806f65f3c90dc0f7921932494228ad93f3ed3027 (diff)
downloadsssd-7c475c3a02329f477f6245cce40d70615e616e85.tar.gz
sssd-7c475c3a02329f477f6245cce40d70615e616e85.tar.xz
sssd-7c475c3a02329f477f6245cce40d70615e616e85.zip
Monitor: Add support for disabling netlink
Resolves: https://fedorahosted.org/sssd/ticket/2860 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
Diffstat (limited to 'src/monitor')
-rw-r--r--src/monitor/monitor.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index f154d8e85..7a9ef569b 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -2340,7 +2340,8 @@ static void missing_resolv_conf(struct tevent_context *ev,
}
static int monitor_process_init(struct mt_ctx *ctx,
- const char *config_file)
+ const char *config_file,
+ bool opt_netlinkoff)
{
TALLOC_CTX *tmp_ctx;
struct tevent_signal *tes;
@@ -2471,12 +2472,14 @@ static int monitor_process_init(struct mt_ctx *ctx,
return ret;
}
- 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;
+ if (opt_netlinkoff == 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 */
@@ -2772,6 +2775,7 @@ int main(int argc, const char *argv[])
int opt_interactive = 0;
int opt_genconf = 0;
int opt_version = 0;
+ int opt_netlinkoff = 0;
char *opt_config_file = NULL;
char *config_file = NULL;
int flags = 0;
@@ -2788,6 +2792,8 @@ int main(int argc, const char *argv[])
_("Become a daemon (default)"), NULL }, \
{"interactive", 'i', POPT_ARG_NONE, &opt_interactive, 0, \
_("Run interactive (not a daemon)"), NULL}, \
+ {"disable-netlink", '\0', POPT_ARG_NONE, &opt_netlinkoff, 0, \
+ _("Disable netlink interface"), NULL}, \
{"config", 'c', POPT_ARG_STRING, &opt_config_file, 0, \
_("Specify a non-default config file"), NULL}, \
{"genconf", 'g', POPT_ARG_NONE, &opt_genconf, 0, \
@@ -2990,8 +2996,8 @@ int main(int argc, const char *argv[])
monitor->ev = main_ctx->event_ctx;
talloc_steal(main_ctx, monitor);
- ret = monitor_process_init(monitor,
- config_file);
+ ret = monitor_process_init(monitor, config_file,
+ opt_netlinkoff);
if (ret != EOK) return 3;
talloc_free(tmp_ctx);