#include <errno.h>
#include <limits.h>
#include <syslog.h>
-#include <dlfcn.h>
+/* #include <dlfcn.h> */
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
void master_startup(void) {
struct timeval tv;
+ lprintf(9, "master_startup() started\n");
lprintf(7, "Opening databases\n");
open_databases();
- if (do_defrag)
+ if (do_defrag) {
defrag_databases();
+ }
- lprintf(7, "Checking floor reference counts\n");
check_ref_counts();
lprintf(7, "Creating base rooms (if necessary)\n");
create_room(SYSCONFIGROOM, 3, "", 0);
create_room(config.c_twitroom, 0, "", 0);
-/* Seed the PRNG */
-
lprintf(7, "Seeding the pseudo-random number generator...\n");
gettimeofday(&tv, NULL);
srand(tv.tv_usec);
+ lprintf(9, "master_startup() finished\n");
}
+
+
/*
* Cleanup routine to be called when the server is shutting down.
*/
/* Run any cleanup routines registered by loadable modules */
for (fcn = CleanupHookTable; fcn != NULL; fcn = fcn->next) {
(*fcn->h_function_pointer)();
- }
+ }
/* Close databases */
lprintf(7, "Closing databases\n");
lprintf(3, "citserver: exiting.\n");
fflush(stdout); fflush(stderr);
exit(0);
- }
+}
/*
lprintf(3, "citserver[%3d]: ended.\n", con->cs_pid);
- syslog(LOG_NOTICE,"session %d ended", con->cs_pid);
+ syslog(LOG_NOTICE,"session %d: ended", con->cs_pid);
/* Deallocate any user-data attached to this session */
deallocate_user_data(con);
lprintf(7, "Closing socket %d\n", con->client_socket);
close(con->client_socket);
- /* Tell the housekeeping thread to check to see if this is the time
- * to initiate a scheduled shutdown event.
- */
- enter_housekeeping_cmd("SCHED_SHUTDOWN");
+ /* This is where we used to check for scheduled shutdowns. */
/* Free up the memory used by this context */
phree(con);
(rev_level % 100),
desc);
- syslog(LOG_NOTICE,"client %d/%d/%01d.%02d (%s)\n",
+ syslog(LOG_NOTICE,"session %d: client %d/%d/%01d.%02d (%s) from %s\n",
+ CC->cs_pid,
dev_code,
cli_code,
(rev_level / 100),
(rev_level % 100),
- desc);
+ desc,
+ CC->cs_host);
cprintf("%d Ok\n",OK);
}