cnid_dbd metadaemon to start up cnid_dbd upon request from afpd. More...
#include <unistd.h>#include <errno.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/types.h>#include <sys/uio.h>#include <sys/un.h>#include <sys/wait.h>#include <time.h>#include <bstrlib.h>#include <pwd.h>#include <grp.h>#include <atalk/util.h>#include <atalk/logger.h>#include <atalk/cnid_bdb_private.h>#include <atalk/compat.h>#include <atalk/errchk.h>#include <atalk/iniparser_util.h>#include <atalk/netatalk_conf.h>#include <atalk/volume.h>#include "usockfd.h"Data Structures | |
| struct | server |
Macros | |
| #define | WEXITSTATUS(stat_val) |
| #define | WIFEXITED(stat_val) |
| #define | WIFSTOPPED(status) |
| #define | WIFSIGNALED(status) |
| #define | WTERMSIG(status) |
| #define | SWITCH_TO_GID(gid) |
| #define | SWITCH_TO_UID(uid) |
| #define | DBHOME ".AppleDB" |
| #define | DBHOMELEN 8 |
| #define | MAXSPAWN 3 |
| #define | TESTTIME 10 |
| #define | MAXVOLS 4096 |
| #define | DEFAULTHOST "localhost" |
| #define | DEFAULTPORT "4700" |
Functions | |
| static void | daemon_exit (int i) |
| static void | sig_handler (int sig) |
| static struct server * | test_usockfn (const char *path) |
| int | maybe_start_dbd (const AFPObj *obj, char *dbdpn, const char *volpath, const char *username) |
| Pass connection request to existing cnid_dbd process or start a new one. | |
| static int | set_dbdir (const char *dbdir, const char *vpath) |
| static void | catch_child (int sig) |
| static void | set_signal (void) |
| static int | setlimits (void) |
| static uid_t | uid_from_name (const char *name) |
| int | main (int argc, char *argv[]) |
Variables | |
| static int | srvfd |
| static int | rqstfd |
| static volatile sig_atomic_t | sigchild = 0 |
| static uint | maxvol |
| static struct server | srv [MAXVOLS] |
cnid_dbd metadaemon to start up cnid_dbd upon request from afpd.
Here is how it works:
cnid_metad and cnid_dbd have been converted to non-blocking IO in 2010.
| #define DBHOME ".AppleDB" |
| #define DBHOMELEN 8 |
| #define DEFAULTHOST "localhost" |
| #define DEFAULTPORT "4700" |
| #define MAXSPAWN 3 |
Max times respawned in..
| #define MAXVOLS 4096 |
| #define SWITCH_TO_GID | ( | gid | ) |
| #define SWITCH_TO_UID | ( | uid | ) |
| #define TESTTIME 10 |
this much seconds apfd client tries to to reconnect every 5 secondes, catch it
| #define WEXITSTATUS | ( | stat_val | ) |
| #define WIFEXITED | ( | stat_val | ) |
| #define WIFSIGNALED | ( | status | ) |
|
static |
|
static |
| int main | ( | int | argc, |
| char * | argv[] ) |
| int maybe_start_dbd | ( | const AFPObj * | obj, |
| char * | dbdpn, | ||
| const char * | volpath, | ||
| const char * | username ) |
Pass connection request to existing cnid_dbd process or start a new one.
| [in] | obj | handle |
| [in] | dbdpn | Path to cnid_dbd binary |
| [in] | volpath | Path of AFP volume |
| [in] | username | Optional username, may be NULL |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |