Call libcitadel init
[citadel.git] / citadel / server_main.c
index 0dc52a0e4667cd6d320be7f7562cfbf4615bd66a..7c6a46434e8a51e7669f9029eff6d8a9dc701920 100644 (file)
@@ -89,6 +89,7 @@ void go_threading(void);
  */
 int main(int argc, char **argv)
 {
+       size_t basesize = 64;
        char facility[32];
        int a;                  /* General-purpose variables */
        struct passwd pw, *pwp = NULL;
@@ -114,7 +115,7 @@ int main(int argc, char **argv)
        InitializeMasterTSD();
 
        /* parse command-line arguments */
-       while ((a=getopt(argc, argv, "l:dh:x:t:Dr")) != EOF) switch(a) {
+       while ((a=getopt(argc, argv, "l:dh:x:t:B:Dr")) != EOF) switch(a) {
 
                case 'l':
                        safestrncpy(facility, optarg, sizeof(facility));
@@ -143,6 +144,9 @@ int main(int argc, char **argv)
 
                case 't':       /* deprecated */
                        break;
+                case 'B': /* Basesize */
+                        basesize = atoi(optarg);
+                        break;
 
                case 'D':
                        dbg = 1;
@@ -165,7 +169,7 @@ int main(int argc, char **argv)
                        );
                        exit(1);
        }
-
+       StartLibCitadel(basesize);
        openlog("citserver",
                ( running_as_daemon ? (LOG_PID) : (LOG_PID | LOG_PERROR) ),
                syslog_facility
@@ -371,7 +375,7 @@ int main(int argc, char **argv)
        }
 
        /* We want to check for idle sessions once per minute */
-       CtdlRegisterSessionHook(terminate_idle_sessions, EVT_TIMER);
+       CtdlRegisterSessionHook(terminate_idle_sessions, EVT_TIMER, PRIO_CLEANUP + 1);
 
        go_threading();