#include "version.h"
#include "config.h"
#include "sharedmemory.h"
+#include "ban.h"
char system_string[64], version_string[64];
int bindport;
for (i = getdtablesize(); i >= 0; --i)
close(i); /* close all descriptors */
+#ifdef USE_GNUTLS
+ gnutls_global_init();
+#endif
+
i = open("/dev/null",O_RDWR);
(void)dup(i);
(void)dup(i);
Log_init(false);
if (pidfile != NULL)
lockfile(pidfile);
-
- switch_user();
-
- /* Reopen log file. If user switch results in access denied, we catch
- * it early.
- */
- Log_reset();
}
else Log_init(true);
Chan_init();
Client_init();
Ban_init();
-
-#ifdef USE_SHAREDMEMORY_API
+
+#ifdef USE_SHAREDMEMORY_API
Sharedmemory_init( bindport, bindport6 );
#endif
-
+
#ifdef POSIX_PRIORITY_SCHEDULING
if (realtime)
setscheduler();
#endif
+ switch_user();
+ /* Reopen log file. If user switch results in access denied, we catch
+ * it early.
+ */
+ Log_reset();
+
Server_run();
#ifdef USE_SHAREDMEMORY_API