diff options
author | Jeremy Allison <jra@samba.org> | 2008-10-03 14:18:35 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2008-10-03 14:18:35 -0700 |
commit | f6c883b4b00f4cd751cd312a27bddffb3be9c059 (patch) | |
tree | 2f05ee49e052f94b2be2f4783715521e114a7cbc /source3/smbd/server.c | |
parent | 4b9cc7d478438e34217add83b2647d47d52268a7 (diff) | |
download | samba-f6c883b4b00f4cd751cd312a27bddffb3be9c059.tar.gz samba-f6c883b4b00f4cd751cd312a27bddffb3be9c059.tar.xz samba-f6c883b4b00f4cd751cd312a27bddffb3be9c059.zip |
Simply our main loop processing. A lot :-). Correctly use events for all the previous "special" cases.
A step on the way to adding signals to the events and being able to merge the S3 event system with
the S4 one.
Jeremy.
Diffstat (limited to 'source3/smbd/server.c')
-rw-r--r-- | source3/smbd/server.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 53116f3d98e..69a483e4fca 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -1067,6 +1067,30 @@ static bool deadtime_fn(const struct timeval *now, void *private_data) return True; } +/* + * Do the recurring log file and smb.conf reload checks. + */ + +static bool housekeeping_fn(const struct timeval *now, void *private_data) +{ + change_to_root_user(); + + /* update printer queue caches if necessary */ + update_monitored_printq_cache(); + + /* check if we need to reload services */ + check_reload(time(NULL)); + + /* Change machine password if neccessary. */ + attempt_machine_password_change(); + + /* + * Force a log file check. + */ + force_check_log_size(); + check_log_size(); + return true; +} /**************************************************************************** main program. @@ -1426,6 +1450,13 @@ extern void build_options(bool screen); exit(1); } + if (!(event_add_idle(smbd_event_context(), NULL, + timeval_set(SMBD_SELECT_TIMEOUT, 0), + "housekeeping", housekeeping_fn, NULL))) { + DEBUG(0, ("Could not add housekeeping event\n")); + exit(1); + } + #ifdef CLUSTER_SUPPORT if (lp_clustering()) { |