#include <errno.h>#include <poll.h>#include <signal.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/param.h>#include <sys/resource.h>#include <sys/socket.h>#include <sys/time.h>#include <sys/uio.h>#include <sys/wait.h>#include <bstrlib.h>#include <event2/event.h>#include <atalk/adouble.h>#include <atalk/afp.h>#include <atalk/compat.h>#include <atalk/dsi.h>#include <atalk/errchk.h>#include <atalk/globals.h>#include <atalk/iniparser_util.h>#include <atalk/logger.h>#include <atalk/netatalk_conf.h>#include <atalk/server_child.h>#include <atalk/server_ipc.h>#include <atalk/util.h>#include "afp_zeroconf.h"Macros | |
| #define | KILL_GRACETIME 5 |
| #define | NETATALK_SRV_NEEDED -1 |
| #define | NETATALK_SRV_OPTIONAL 0 |
| #define | NETATALK_SRV_ERROR NETATALK_SRV_NEEDED |
| #define | MYARVSIZE 64 |
Functions | |
| static pid_t | run_process (const char *path,...) |
| static void | kill_childs (int sig,...) |
| static bool | service_running (pid_t pid) |
| static int | set_sl_volumes (void) |
| static void | libevent_logmsg_cb (int severity, const char *msg) |
| static void | sigterm_cb (evutil_socket_t fd, short what, void *arg) |
| static void | sigquit_cb (evutil_socket_t fd, short what, void *arg) |
| static void | sighup_cb (evutil_socket_t fd, short what, void *arg) |
| static void | sigchld_cb (evutil_socket_t fd, short what, void *arg) |
| static void | timer_cb (evutil_socket_t fd, short what, void *arg) |
| static void | netatalk_exit (int ret) |
| static void | show_netatalk_version (void) |
| static void | show_netatalk_paths (void) |
| static void | usage (void) |
| int | main (int argc, char **argv) |
Variables | |
| static AFPObj | obj |
| static pid_t | afpd_pid = NETATALK_SRV_NEEDED |
| static pid_t | cnid_metad_pid = NETATALK_SRV_OPTIONAL |
| static pid_t | dbus_pid = NETATALK_SRV_OPTIONAL |
| static uint | afpd_restarts |
| static uint | cnid_metad_restarts |
| static uint | dbus_restarts |
| static struct event_base * | base |
| struct event * | sigterm_ev |
| struct event * | sigquit_ev |
| struct event * | sigchld_ev |
| struct event * | sighup_ev |
| struct event * | timer_ev |
| static int | in_shutdown |
| static const char * | dbus_path |
| #define KILL_GRACETIME 5 |
how many seconds we wait to shutdown from SIGTERM before we send SIGKILL
| #define MYARVSIZE 64 |
| #define NETATALK_SRV_ERROR NETATALK_SRV_NEEDED |
| #define NETATALK_SRV_NEEDED -1 |
| #define NETATALK_SRV_OPTIONAL 0 |
|
static |
kill processes passed as varargs of type "pid_t *", terminate list with NULL
|
static |
libevent logging callback
| int main | ( | int | argc, |
| char ** | argv ) |
|
static |
this get called when error conditions are met that require us to exit gracefully
|
static |
this forks() and exec() "path" with varags as argc[]
|
static |
|
static |
Set indexers to index all our volumes
|
static |
|
static |
|
static |
SIGCHLD callback
|
static |
SIGHUP callback
|
static |
SIGQUIT callback
|
static |
SIGTERM callback
|
static |
timer callback
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| struct event * sigchld_ev |
| struct event * sighup_ev |
| struct event * sigquit_ev |
| struct event* sigterm_ev |
| struct event * timer_ev |