/* ------------------ */ static void afp_goaway(int sig) { AFPConfig *config; #ifndef NO_DDP asp_kill(sig); #endif /* ! NO_DDP */ switch( sig ) { case SIGTERM: case SIGQUIT: switch (sig) { case SIGTERM: LOG(log_note, logtype_afpd, "AFP Server shutting down on SIGTERM"); break; case SIGQUIT: LOG(log_note, logtype_afpd, "AFP Server shutting down on SIGQUIT, NOT disconnecting clients"); break; } 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); 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 : /* 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" ); } return; }
static void daemon_exit(int i) { server_unlock(_PATH_CNID_METAD_LOCK); exit(i); }
/* This is registered with atexit() */ static void afp_exit(void) { if (parent_or_child == 0) /* Only do this in the parent */ server_unlock(default_options.pidfile); }
/* this get called when error conditions are met that require us to exit gracefully */ static void netatalk_exit(int ret) { server_unlock(PATH_NETATALK_LOCK); exit(ret); }
int server_lock_callback(unused void *data, const char *s) { return (server_unlock(s)); }