diff options
author | Michal Zidek <mzidek@redhat.com> | 2012-09-11 18:44:52 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-09-24 13:09:53 +0200 |
commit | 99c99e557020775714f028b28a147edda290c783 (patch) | |
tree | 7364f53b4c921aacf7f81da4864f27d3c9d25c62 /src/monitor | |
parent | 7c2e91ac48b20e6699d5c98c9912ea6427453c95 (diff) | |
download | sssd-99c99e557020775714f028b28a147edda290c783.tar.gz sssd-99c99e557020775714f028b28a147edda290c783.tar.bz2 sssd-99c99e557020775714f028b28a147edda290c783.zip |
sss_cache tool invalidates records in memory cache.
Diffstat (limited to 'src/monitor')
-rw-r--r-- | src/monitor/monitor.c | 12 | ||||
-rw-r--r-- | src/monitor/monitor_interfaces.h | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 50b2e952..a9422787 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -51,6 +51,7 @@ #include "dbus/dbus.h" #include "sbus/sssd_dbus.h" #include "monitor/monitor_interfaces.h" +#include "responder/nss/nsssrv.h" #ifdef USE_KEYRING #include <keyutils.h> @@ -701,6 +702,10 @@ static int service_signal_rotate(struct mt_svc *svc) { return service_signal(svc, MON_CLI_METHOD_ROTATE); } +static int service_signal_clear_memcache(struct mt_svc *svc) +{ + return service_signal(svc, MON_CLI_METHOD_CLEAR_MEMCACHE); +} static int check_domain_ranges(struct sss_domain_info *domains) { @@ -1177,10 +1182,15 @@ static void monitor_hup(struct tevent_context *ev, DEBUG(1, ("Received SIGHUP.\n")); - /* Signal all services to rotate debug files */ + /* Send D-Bus message to other services to rotate their logs. + * NSS service receives also message to clear memory caches. */ for(cur_svc = ctx->svc_list; cur_svc; cur_svc = cur_svc->next) { service_signal_rotate(cur_svc); + if (!strcmp(NSS_SBUS_SERVICE_NAME, cur_svc->name)) { + service_signal_clear_memcache(cur_svc); + } } + } static int monitor_cleanup(void) diff --git a/src/monitor/monitor_interfaces.h b/src/monitor/monitor_interfaces.h index 51ac254c..abe90503 100644 --- a/src/monitor/monitor_interfaces.h +++ b/src/monitor/monitor_interfaces.h @@ -45,6 +45,7 @@ #define MON_CLI_METHOD_OFFLINE "goOffline" /* Applicable only to providers */ #define MON_CLI_METHOD_RESET_OFFLINE "resetOffline" /* Applicable only to providers */ #define MON_CLI_METHOD_ROTATE "rotateLogs" +#define MON_CLI_METHOD_CLEAR_MEMCACHE "clearMemcache" #define SSSD_SERVICE_PIPE "private/sbus-monitor" |