summaryrefslogtreecommitdiffstats
path: root/src
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
parent685f34e2ca90a761feab79e348faa22adf44954a (diff)
downloadsssd_unused-a2a695539c79316812fd9d7a1936331784d0e8c3.tar.gz
sssd_unused-a2a695539c79316812fd9d7a1936331784d0e8c3.tar.xz
sssd_unused-a2a695539c79316812fd9d7a1936331784d0e8c3.zip
Add SIGUSR2 to reset offline status
Diffstat (limited to 'src')
-rw-r--r--src/man/sssd.8.xml9
-rw-r--r--src/monitor/monitor.c29
2 files changed, 38 insertions, 0 deletions
diff --git a/src/man/sssd.8.xml b/src/man/sssd.8.xml
index eaf37ca3..bab37b21 100644
--- a/src/man/sssd.8.xml
+++ b/src/man/sssd.8.xml
@@ -150,6 +150,15 @@
</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>SIGUSR2</term>
+ <listitem>
+ <para>
+ Tells the SSSD to go online immediately. This is mostly
+ useful for testing purposes.
+ </para>
+ </listitem>
+ </varlistentry>
</variablelist>
</refsect1>
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;
}