CNID DBD (Database Daemon) Backend startup routines. More...
#include <arpa/inet.h>#include <errno.h>#include <fcntl.h>#include <signal.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/file.h>#include <sys/param.h>#include <sys/stat.h>#include <sys/types.h>#include <time.h>#include <unistd.h>#include <bstrlib.h>#include <atalk/cnid_bdb_private.h>#include <atalk/errchk.h>#include <atalk/logger.h>#include <atalk/netatalk_conf.h>#include <atalk/util.h>#include "db_param.h"#include "dbd.h"#include "dbif.h"#include "pack.h"#include "comm.h"Macros | |
| #define | DBOPTIONS (DB_CREATE | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN) |
Functions | |
| static void | sig_exit (int signo) |
| static void | block_sigs_onoff (int block) |
| static int | get_lock (int cmd, const char *dbpath) |
| Get lock on db lock file. | |
| static int | open_db (void) |
| static int | delete_db (void) |
| static int | reinit_db (void) |
| Close dbd if open, delete it, reopen. | |
| static int | loop (struct db_param *dbp) |
| static void | switch_to_user (char *dir) |
| static void | set_signal (void) |
| static uid_t | uid_from_name (const char *name) |
| int | main (int argc, char *argv[]) |
Variables | |
| static DBD * | dbd |
| static int | exit_sig = 0 |
| static int | db_locked |
| static bstring | dbpath |
| static struct db_param * | dbp |
| static struct vol * | vol |
CNID DBD (Database Daemon) Backend startup routines.
The dbd_XXX and comm_XXX functions all obey the same protocol for return values:
We always try to notify the client process about the outcome, the result field of the cnid_dbd_rply structure contains further details.
| #define DBOPTIONS (DB_CREATE | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN) |
|
static |
|
static |
|
static |
Get lock on db lock file.
| [in] | cmd | lock command:
|
| [in] | dbpath | path to lockfile, only used on first call, later the stored fd is used |
|
static |
| int main | ( | int | argc, |
| char * | argv[] ) |
|
static |
|
static |
Close dbd if open, delete it, reopen.
Also tries to copy the rootinfo key, that would allow for keeping the db stamp and last used CNID
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |