X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fmain.c;h=5e4da980f62b70081ae79d938a545eac999a46cf;hb=9fc93175b31054cc75765431f4a5d41f1b453bb7;hp=0d552d6f73c77faa3478f4a37702fb630aa6e7a3;hpb=18964cebf514f78defd3df1cfed91e34d99cfa28;p=netatalk.git diff --git a/etc/afpd/main.c b/etc/afpd/main.c index 0d552d6f..5e4da980 100644 --- a/etc/afpd/main.c +++ b/etc/afpd/main.c @@ -104,25 +104,25 @@ static void fd_reset_listening_sockets(void) continue; fdset_del_fd(&fdset, &polldata, &fdset_used, &fdset_size, config->fd); } - fd_set_listening_sockets(); } /* ------------------ */ static void afp_goaway(int sig) { + AFPConfig *config; #ifndef NO_DDP 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); @@ -130,10 +130,24 @@ static void afp_goaway(int sig) exit(0); break; + case SIGQUIT: + LOG(log_note, logtype_afpd, "AFP Server shutting down on SIGQUIT, NOT disconnecting clients"); + + for (config = configs; config; config = config->next) + if (config->server_cleanup) + config->server_cleanup(config); + + server_unlock(default_options.pidfile); + exit(0); + break; + case SIGUSR1 : 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 +351,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 +365,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)