X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fmain.c;h=9e34712e79f6b12887dd15a52f39a8c707b7b47d;hb=75f0882aca367c96283169457942696927fbd8fd;hp=0d552d6f73c77faa3478f4a37702fb630aa6e7a3;hpb=6145c1c31a1a2494fe6ad7ca65f9c2a63a05b07d;p=netatalk.git diff --git a/etc/afpd/main.c b/etc/afpd/main.c index 0d552d6f..9e34712e 100644 --- a/etc/afpd/main.c +++ b/etc/afpd/main.c @@ -104,7 +104,6 @@ static void fd_reset_listening_sockets(void) continue; fdset_del_fd(&fdset, &polldata, &fdset_used, &fdset_size, config->fd); } - fd_set_listening_sockets(); } /* ------------------ */ @@ -115,14 +114,16 @@ static void afp_goaway(int sig) asp_kill(sig); #endif /* ! NO_DDP */ - if (server_children) - server_child_kill(server_children, CHILD_DSIFORK, sig); switch( sig ) { case SIGTERM : LOG(log_note, logtype_afpd, "AFP Server shutting down on SIGTERM"); AFPConfig *config; + + if (server_children) + server_child_kill(server_children, CHILD_DSIFORK, sig); + for (config = configs; config; config = config->next) if (config->server_cleanup) config->server_cleanup(config); @@ -134,6 +135,9 @@ static void afp_goaway(int sig) nologin++; auth_unload(); LOG(log_info, logtype_afpd, "disallowing logins"); + + if (server_children) + server_child_kill(server_children, CHILD_DSIFORK, sig); break; case SIGHUP : @@ -337,6 +341,7 @@ int main(int ac, char **av) if (reloadconfig) { nologin++; auth_unload(); + fd_reset_listening_sockets(); LOG(log_info, logtype_afpd, "re-reading configuration file"); for (config = configs; config; config = config->next) @@ -350,10 +355,13 @@ int main(int ac, char **av) LOG(log_error, logtype_afpd, "config re-read: no servers configured"); exit(EXITERR_CONF); } - fd_reset_listening_sockets(); + + fd_set_listening_sockets(); + nologin = 0; reloadconfig = 0; errno = saveerrno; + continue; } if (ret == 0)