diff options
author | Jeremy Allison <jra@samba.org> | 2012-05-31 12:35:04 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2012-05-31 12:35:04 -0700 |
commit | f6e41026f89deb5393e239b9dc83b287e5c7d6ed (patch) | |
tree | 1f31ea392d16d380024dd130e469f2314abe262c | |
parent | 671874726817f3dd1c448fca193bd97002f6971d (diff) | |
download | samba-f6e41026f89deb5393e239b9dc83b287e5c7d6ed.tar.gz samba-f6e41026f89deb5393e239b9dc83b287e5c7d6ed.tar.bz2 samba-f6e41026f89deb5393e239b9dc83b287e5c7d6ed.zip |
We are triggering the cleanup_timeout_fn() too often, on exiting when an smbd is idle.
Calls to exit_server_cleanly() should be treated as a "clean" shutdown,
and not trigger the master smbd to call cleanup_timeout_fn.
-rw-r--r-- | source3/smbd/server_exit.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/source3/smbd/server_exit.c b/source3/smbd/server_exit.c index aa22c158bf..9ff3cad109 100644 --- a/source3/smbd/server_exit.c +++ b/source3/smbd/server_exit.c @@ -84,7 +84,6 @@ static void exit_server_common(enum server_exit_reason how, static void exit_server_common(enum server_exit_reason how, const char *const reason) { - bool had_open_conn = false; struct smbXsrv_connection *conn = global_smbXsrv_connection; struct smbd_server_connection *sconn = NULL; struct messaging_context *msg_ctx = server_messaging_context(); @@ -108,7 +107,7 @@ static void exit_server_common(enum server_exit_reason how, bool found = false; files_forall(sconn, log_writeable_file_fn, &found); } - had_open_conn = conn_close_all(sconn); + (void)conn_close_all(sconn); invalidate_all_vuids(sconn); } @@ -183,6 +182,8 @@ static void exit_server_common(enum server_exit_reason how, dump_core(); + /* Notreached. */ + exit(1); } else { DEBUG(3,("Server exit (%s)\n", (reason ? reason : "normal exit"))); @@ -192,15 +193,7 @@ static void exit_server_common(enum server_exit_reason how, gencache_stabilize(); } - /* if we had any open SMB connections when we exited then we - need to tell the parent smbd so that it can trigger a retry - of any locks we may have been holding or open files we were - blocking */ - if (had_open_conn) { - exit(1); - } else { - exit(0); - } + exit(0); } void exit_server(const char *const explanation) |