From: Andre Noll Date: Mon, 12 Jan 2009 16:34:19 +0000 (+0100) Subject: Improve SIGHUP handling for afs. X-Git-Tag: v0.3.4~75^2~15 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=923478d229dc412db2f2c7520b1a8f1b6abc89c1;p=paraslash.git Improve SIGHUP handling for afs. Make afs also reload the config file and reopen its log file. The old code did not honor for example loglevel changes. --- diff --git a/afs.c b/afs.c index 02b6b56d..9ae0650a 100644 --- a/afs.c +++ b/afs.c @@ -766,6 +766,7 @@ static void signal_post_select(struct sched *s, struct task *t) st->signum = para_next_signal(); if (st->signum == SIGHUP) { close_afs_tables(); + parse_config_or_die(1); t->error = open_afs_tables(); if (t->error < 0) return; diff --git a/server.c b/server.c index a1180673..436e72af 100644 --- a/server.c +++ b/server.c @@ -198,13 +198,15 @@ err_out: exit(EXIT_FAILURE); } -static void parse_config_or_die(int override) +void parse_config_or_die(int override) { char *home = para_homedir(); struct stat statbuf; int ret; char *cf; + close_log(logfile); + logfile = NULL; if (conf.config_file_given) cf = para_strdup(conf.config_file_arg); else @@ -257,8 +259,6 @@ static void signal_pre_select(struct sched *s, struct task *t) static void handle_sighup(void) { PARA_NOTICE_LOG("SIGHUP\n"); - close_log(logfile); /* gets reopened if necessary by parse_config */ - logfile = NULL; parse_config_or_die(1); /* reopens log */ init_user_list(user_list_file); /* reload user list */ if (mmd->afs_pid) diff --git a/server.h b/server.h index 5678d95b..b133d82e 100644 --- a/server.h +++ b/server.h @@ -106,3 +106,4 @@ struct misc_meta_data { extern struct server_args_info conf; __noreturn void handle_connect(int fd, const char *peername); +void parse_config_or_die(int override);