diff options
Diffstat (limited to 'source4/smbd/server.c')
-rw-r--r-- | source4/smbd/server.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/source4/smbd/server.c b/source4/smbd/server.c index c92988352f2..9068bfcaeb8 100644 --- a/source4/smbd/server.c +++ b/source4/smbd/server.c @@ -155,6 +155,19 @@ static void sigterm_signal_handler(struct tevent_context *ev, sig_term(SIGTERM); } +static void sighup_signal_handler(struct tevent_context *ev, + struct tevent_signal *se, + int signum, int count, void *siginfo, + void *private_data) +{ + struct server_state *state = talloc_get_type_abort( + private_data, struct server_state); + + DBG_DEBUG("Process %s got SIGHUP\n", state->binary_name); + + reopen_logs_internal(); +} + /* setup signal masks */ @@ -832,6 +845,22 @@ static int binary_smbd_main(const char *binary_name, return 1; } + se = tevent_add_signal(state->event_ctx, + state->event_ctx, + SIGHUP, + 0, + sighup_signal_handler, + state); + if (se == NULL) { + TALLOC_FREE(state); + exit_daemon("Initialize SIGHUP handler failed", ENOMEM); + /* + * return is never reached but is here to satisfy static + * checkers + */ + return 1; + } + if (lpcfg_server_role(cmdline_lp_ctx) != ROLE_ACTIVE_DIRECTORY_DC && !lpcfg_parm_bool(cmdline_lp_ctx, NULL, "server role check", "inhibit", false) |