summaryrefslogtreecommitdiff
path: root/src/monitor
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2010-11-19 21:09:47 +0100
committerStephen Gallagher <sgallagh@redhat.com>2010-11-22 08:54:14 -0500
commita2a695539c79316812fd9d7a1936331784d0e8c3 (patch)
tree1bedc7655706dd9b8d8000e7aa510d318c2f6f6a /src/monitor
parent685f34e2ca90a761feab79e348faa22adf44954a (diff)
downloadsssd-a2a695539c79316812fd9d7a1936331784d0e8c3.tar.gz
sssd-a2a695539c79316812fd9d7a1936331784d0e8c3.tar.bz2
sssd-a2a695539c79316812fd9d7a1936331784d0e8c3.zip
Add SIGUSR2 to reset offline status
Diffstat (limited to 'src/monitor')
-rw-r--r--src/monitor/monitor.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 98b671b2..3eca7649 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -1266,6 +1266,27 @@ static void signal_offline(struct tevent_context *ev,
}
}
+static void signal_offline_reset(struct tevent_context *ev,
+ struct tevent_signal *se,
+ int signum,
+ int count,
+ void *siginfo,
+ void *private_data)
+{
+ struct mt_ctx *monitor;
+ struct mt_svc *cur_svc;
+
+ monitor = talloc_get_type(private_data, struct mt_ctx);
+
+ DEBUG(8, ("Signaling providers to reset offline immediately.\n"));
+
+ for(cur_svc = monitor->svc_list; cur_svc; cur_svc = cur_svc->next) {
+ if (cur_svc->provider) {
+ service_signal_reset_offline(cur_svc);
+ }
+ }
+}
+
int read_config_file(const char *config_file)
{
int ret;
@@ -1910,6 +1931,14 @@ int monitor_process_init(struct mt_ctx *ctx,
return EIO;
}
+ /* Handle SIGUSR2 (tell all providers to go reset offline) */
+ BlockSignals(false, SIGUSR2);
+ tes = tevent_add_signal(ctx->ev, ctx, SIGUSR2, 0,
+ signal_offline_reset, ctx);
+ if (tes == NULL) {
+ return EIO;
+ }
+
return EOK;
}