- citserver_pid = start_citadel();
- webcit_pid = start_webcit();
- webcits_pid = start_webcits();
+ // "migrate mode" means we just start the server and then run ctdlmigrate interactively.
+ if (migrate_mode) {
+ citserver_pid = start_citadel();
+ fprintf(stderr, "ctdlvisor: waiting a moment for citserver to initialize...\n");
+ sleep(5);
+ char bin[1024];
+ sprintf(bin, "%s/usr/local/citadel/ctdlmigrate", getenv("APPDIR"));
+ system(bin);
+ kill(citserver_pid, SIGTERM);
+ }
+
+ // Otherwise, it's just a normal happy day in Citadel land.
+ else {
+ signal(SIGTERM, signal_handler);
+ signal(SIGINT, signal_handler);
+ signal(SIGQUIT, signal_handler);
+
+ citserver_pid = start_citadel();
+ webcit_pid = start_webcit();
+ webcits_pid = start_webcits();
+
+ main_loop();
+ }