+ calc_dirs_n_files(relh, home, relhome, ctdldir, dbg);
+ /* daemonize, if we were asked to */
+ if (running_as_daemon) {
+ start_daemon(0);
+ drop_root_perms = 1;
+ }
+
+#ifdef HAVE_BACKTRACE
+ bzero(¶ms, sizeof(params));
+ params.filename = file_pid_paniclog;
+ panic_fd=open(file_pid_paniclog, O_APPEND|O_CREAT|O_DIRECT);
+ params.filep = fopen(file_pid_paniclog, "a+");
+ params.debugLevel = ECRASH_DEBUG_VERBOSE;
+ params.dumpAllThreads = TRUE;
+ params.useBacktraceSymbols = 1;
+ params.signals[0]=SIGSEGV;
+ params.signals[1]=SIGILL;
+ params.signals[2]=SIGBUS;
+ params.signals[3]=SIGABRT;
+ eCrash_Init(¶ms);
+ eCrash_RegisterThread("MasterThread", 0);
+#endif
+
+ /* Initialize the syslogger. Yes, we are really using 0 as the
+ * facility, because we are going to bitwise-OR the facility to
+ * the severity of each message, allowing us to write to other
+ * facilities when we need to...
+ */
+ if (enable_syslog) {
+ openlog("citadel", LOG_NDELAY, 0);
+ setlogmask(LOG_UPTO(verbosity));
+ }
+