dsi_kill(sig);
switch( sig ) {
+
case SIGTERM :
- LOG(log_info, logtype_afpd, "shutting down on signal %d", sig );
+ LOG(log_note, logtype_afpd, "AFP Server shutting down on SIGTERM");
+ AFPConfig *config;
+ for (config = configs; config; config = config->next)
+ if (config->server_cleanup)
+ config->server_cleanup(config);
+ afp_exit(0);
break;
+
case SIGUSR1 :
- case SIGHUP :
- /* w/ a configuration file, we can force a re-read if we want */
nologin++;
auth_unload();
- if (sig == SIGHUP || ((nologin + 1) & 1)) {
- AFPConfig *config;
-
- LOG(log_info, logtype_afpd, "re-reading configuration file");
- for (config = configs; config; config = config->next)
- if (config->server_cleanup)
- config->server_cleanup(config);
+ LOG(log_info, logtype_afpd, "disallowing logins");
+ break;
- /* configfree close atp socket used for DDP tickle, there's an issue
- * with atp tid.
- */
- configfree(configs, NULL);
- if (!(configs = configinit(&default_options))) {
- LOG(log_error, logtype_afpd, "config re-read: no servers configured");
- afp_exit(EXITERR_CONF);
- }
- set_fd(Ipc_fd);
- } else {
- LOG(log_info, logtype_afpd, "disallowing logins");
- }
- if (sig == SIGHUP) {
- nologin = 0;
- }
+ case SIGHUP :
+ /* w/ a configuration file, we can force a re-read if we want */
+ reloadconfig = 1;
break;
+
default :
LOG(log_error, logtype_afpd, "afp_goaway: bad signal" );
}