DEFAULT_MAXLOCKOBJS, /* maxlockobjs */
0, /* flush_interval */
0, /* flush_frequency */
- 1000, /* txn_frequency */
0, /* usock_file */
-1, /* fd_table_size */
-1, /* idle_timeout */
close(dbdirfd);
}
+ /*
+ Before we do anything else, check if there is an instance of cnid_dbd
+ running already and silently exit if yes.
+ */
+ lockfd = get_lock(dbpath);
+
/* Prepare upgrade ? */
if (prep_upgrade) {
- lockfd = get_lock(dbpath);
if (dbif_env_remove(dbpath))
goto exit_failure;
goto exit_success;
/* Check if -f is requested and wipe db if yes */
if ((flags & DBD_FLAGS_FORCE) && rebuild && (volinfo.v_flags & AFPVOL_CACHE)) {
char cmd[8 + MAXPATHLEN];
+ close(lockfd);
snprintf(cmd, 8 + MAXPATHLEN, "rm -rf \"%s\"", dbpath);
dbd_log( LOGDEBUG, "Removing old database of volume: '%s'", volpath);
system(cmd);
exit(EXIT_FAILURE);
}
dbd_log( LOGDEBUG, "Removed old database.");
+ lockfd = get_lock(dbpath);
}
- /*
- Before we do anything else, check if there is an instance of cnid_dbd
- running already and silently exit if yes.
- */
- lockfd = get_lock(dbpath);
-
/*
Lets start with the BerkeleyDB stuff
*/