diff options
author | Sumit Bose <sbose@redhat.com> | 2010-11-19 21:09:47 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-11-22 08:54:14 -0500 |
commit | a2a695539c79316812fd9d7a1936331784d0e8c3 (patch) | |
tree | 1bedc7655706dd9b8d8000e7aa510d318c2f6f6a | |
parent | 685f34e2ca90a761feab79e348faa22adf44954a (diff) | |
download | sssd-a2a695539c79316812fd9d7a1936331784d0e8c3.tar.gz sssd-a2a695539c79316812fd9d7a1936331784d0e8c3.tar.xz sssd-a2a695539c79316812fd9d7a1936331784d0e8c3.zip |
Add SIGUSR2 to reset offline status
-rw-r--r-- | src/man/sssd.8.xml | 9 | ||||
-rw-r--r-- | src/monitor/monitor.c | 29 |
2 files changed, 38 insertions, 0 deletions
diff --git a/src/man/sssd.8.xml b/src/man/sssd.8.xml index eaf37ca3e..bab37b214 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 98b671b29..3eca76498 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; } |