X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fserver_main.c;h=592ea7708bbc620f518e10eb21af59406b86642d;hb=a793d2fbf5e0aa9151490b76defd22f6db7ef7ed;hp=f27baeb6073ab28d9f3a5a6d7480cae3695677bf;hpb=6e3ac9b743a16b4ab69fec6575f92d5e6de25d65;p=citadel.git diff --git a/citadel/server_main.c b/citadel/server_main.c index f27baeb60..592ea7708 100644 --- a/citadel/server_main.c +++ b/citadel/server_main.c @@ -1,7 +1,15 @@ /* * citserver's main() function lives here. + * + * Copyright (c) 1987-2012 by the citadel.org team * - * $Id$ + * This program is open source software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ #include "sysdep.h" @@ -38,24 +46,29 @@ #include #include #include -#ifdef HAVE_PTHREAD_H -#include -#endif #ifdef HAVE_SYS_PRCTL_H #include #endif +#include #include "citadel.h" #include "server.h" #include "serv_extensions.h" #include "sysdep_decls.h" +#include "threads.h" #include "citserver.h" #include "support.h" #include "config.h" #include "control.h" #include "database.h" +#include "user_ops.h" #include "housekeeping.h" -#include "tools.h" -#include "citadel_dirs.c" +#include "svn_revision.h" +#include "citadel_dirs.h" + +#include "context.h" + +#include "modules_init.h" +#include "ecrash.h" #ifdef HAVE_SYS_SELECT_H #include @@ -64,8 +77,12 @@ #ifndef HAVE_SNPRINTF #include "snprintf.h" #endif +const char *CitadelServiceUDS="citadel-UDS"; +const char *CitadelServiceTCP="citadel-TCP"; -int running_as_daemon = 0; + + +void go_threading(void); /* * Here's where it all begins. @@ -73,21 +90,27 @@ int running_as_daemon = 0; int main(int argc, char **argv) { char facility[32]; - int a, i; /* General-purpose variables */ + int a; /* General-purpose variables */ struct passwd pw, *pwp = NULL; char pwbuf[SIZ]; int drop_root_perms = 1; - size_t size; int relh=0; int home=0; + int dbg=0; char relhome[PATH_MAX]=""; char ctdldir[PATH_MAX]=CTDLDIR; + int syslog_facility = LOG_DAEMON; #ifdef HAVE_RUN_DIR struct stat filestats; #endif - +#ifdef HAVE_BACKTRACE + eCrashParameters params; +// eCrashSymbolTable symbol_table; +#endif + /* initialize the master context */ InitializeMasterCC(); + InitializeMasterTSD(); /* parse command-line arguments */ for (a=1; atid, NULL); - master_cleanup(0); + go_threading(); + + master_cleanup(exit_signal); return(0); }