get_config() is now called from master_startup() immediately after the databases...
authorArt Cancro <ajc@uncensored.citadel.org>
Mon, 20 Apr 2015 22:44:27 +0000 (18:44 -0400)
committerArt Cancro <ajc@uncensored.citadel.org>
Mon, 20 Apr 2015 22:44:27 +0000 (18:44 -0400)
citadel/citserver.c
citadel/server_main.c

index 765556cafbf3e4de3de1a03924b2b1d25a99b3db..0ba31244673aede1d1af89dca0b4de503157842d 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * Main source module for the Citadel server
  *
- * Copyright (c) 1987-2014 by the citadel.org team
+ * Copyright (c) 1987-2015 by the citadel.org team
  *
  * 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.
@@ -124,7 +124,7 @@ void master_startup(void) {
        time(&server_startup_time);
 
        syslog(LOG_INFO, "Checking directory access");
-       if ((pw = getpwuid(CTDLUID)) == NULL) {
+       if ((pw = getpwuid(ctdluid)) == NULL) {
                gid = getgid();
        } else {
                gid = pw->pw_gid;
@@ -136,6 +136,17 @@ void master_startup(void) {
        }
        syslog(LOG_INFO, "Opening databases");
        open_databases();
+
+       /* Load site-specific configuration */
+       syslog(LOG_INFO, "Loading citadel.config");
+       get_config();
+       validate_config();
+
+       syslog(LOG_INFO, "Acquiring control record");
+       get_control();
+       put_config();
+
+       /* Check floor reference counts */
        check_ref_counts();
 
        syslog(LOG_INFO, "Creating base rooms (if necessary)\n");
index 9837f86e54c3537e71bc0ee779286d45d3cf88be..bcb55cb7044bcedb40ed1f6faec2420f6a4ad55a 100644 (file)
@@ -202,17 +202,6 @@ int main(int argc, char **argv)
        syslog(LOG_DEBUG, "Called as: %s", argv[0]);
        syslog(LOG_INFO, "%s", libcitadel_version_string());
 
-       /* Load site-specific configuration */
-       syslog(LOG_INFO, "Loading citadel.config");
-       get_config();
-       validate_config();
-
-       /* get_control() MUST MUST MUST be called BEFORE the databases are opened!! */
-       syslog(LOG_INFO, "Acquiring control record");
-       get_control();
-
-       put_config();
-
 #ifdef HAVE_RUN_DIR
        /* on some dists rundir gets purged on startup. so we need to recreate it. */