]> git.tue.mpg.de Git - paraslash.git/commitdiff
Improve SIGHUP handling for afs.
authorAndre Noll <maan@systemlinux.org>
Mon, 12 Jan 2009 16:34:19 +0000 (17:34 +0100)
committerAndre Noll <maan@systemlinux.org>
Mon, 12 Jan 2009 16:34:19 +0000 (17:34 +0100)
Make afs also reload the config file and reopen its log file. The old
code did not honor for example loglevel changes.

afs.c
server.c
server.h

diff --git a/afs.c b/afs.c
index 02b6b56db561d5a7ef2f9464dc2c1f1c54f35fec..9ae0650a2955f6683a94428df47ae2d6c836817e 100644 (file)
--- 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;
index a1180673c7f72a228460466cbe56acd37f529c84..436e72af9c7c5b86eadb217d194fb44cf74db5ed 100644 (file)
--- 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)
index 5678d95b2860b61a0177cf813434d9605fb40c78..b133d82eb66f3b72c8090eda2641611369a85300 100644 (file)
--- 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);