summaryrefslogtreecommitdiffstats
path: root/server/monitor/monitor.h
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-06-24 07:53:48 -0400
committerSimo Sorce <ssorce@redhat.com>2009-07-20 10:50:52 -0400
commit7ac82a61aff588daaa1c217889b3055538380e47 (patch)
tree3ac08fc6ce51ccbb6ffbf37d1a3b9ff8f2d22a44 /server/monitor/monitor.h
parentf6525c7259fe0c731157828ef12804fd09228fa0 (diff)
downloadsssd-7ac82a61aff588daaa1c217889b3055538380e47.tar.gz
sssd-7ac82a61aff588daaa1c217889b3055538380e47.tar.xz
sssd-7ac82a61aff588daaa1c217889b3055538380e47.zip
Monitor resolv.conf for changes
This patch updates the monitor_config_file() functions so that they can monitor any number of files and invoke a specified callback whenever they are modified. When inotify is available, we will add an additional watch descriptor to the inotify file descriptor. When inotify is not available, the polling function will simply loop to check each file in the monitor list. When changes are discovered in resolv.conf, the monitor will send a "resInit" signal to all of its known children. They are only required to handle this function if they need updated DNS information. Services that do not implement resInit should return DBUS_ERROR_UNKNOWN_METHOD (rather than timing out) with no ill effects.
Diffstat (limited to 'server/monitor/monitor.h')
-rw-r--r--server/monitor/monitor.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/monitor/monitor.h b/server/monitor/monitor.h
index 2a5218b14..0127bbffd 100644
--- a/server/monitor/monitor.h
+++ b/server/monitor/monitor.h
@@ -22,8 +22,12 @@
#ifndef _MONITOR_H_
#define _MONITOR_H_
+#define RESOLV_CONF_PATH "/etc/resolv.conf"
#define CONFIG_FILE_POLL_INTERVAL 5 /* seconds */
+typedef int (*monitor_reconf_fn) (struct config_file_ctx *file_ctx,
+ const char *filename);
+
int monitor_process_init(TALLOC_CTX *mem_ctx,
struct tevent_context *event_ctx,
struct confdb_ctx *cdb,