src/server/daemon/webserver.c

changeset 426
6a2e7a464991
parent 415
d938228c382e
child 427
a327cb6cc868
equal deleted inserted replaced
425:6440171c257f 426:6a2e7a464991
90 log_ereport(LOG_FAILURE, "resource pool init failed"); 90 log_ereport(LOG_FAILURE, "resource pool init failed");
91 return -1; 91 return -1;
92 } 92 }
93 93
94 // load init.conf 94 // load init.conf
95 if(load_init_conf("config/init.conf")) { 95 InitConfig *init_config = load_init_conf("config/init.conf");
96 if(!init_config) {
96 return -1; 97 return -1;
97 } 98 }
98 99
99 // load server.conf 100 // load server.conf
100 // Only the runtime infos are stored in the ServerConfiguration at 101 // Only the runtime infos are stored in the ServerConfiguration at
105 if(cfgmgr_load_config(&mgr) != 0) { 106 if(cfgmgr_load_config(&mgr) != 0) {
106 return -1; 107 return -1;
107 } 108 }
108 log_ereport(LOG_VERBOSE, "cfgmgr_load_config stage 1 successful"); 109 log_ereport(LOG_VERBOSE, "cfgmgr_load_config stage 1 successful");
109 ServerConfiguration *cfg = mgr.cfg; 110 ServerConfiguration *cfg = mgr.cfg;
110
111 // init caches
112 auth_cache_init();
113
114 // init SAFs
115 common_saf_init();
116 111
117 // set global vars 112 // set global vars
118 conf_global_vars_s *vars = conf_getglobals(); 113 conf_global_vars_s *vars = conf_getglobals();
119 114
120 WSBool changeuid = FALSE; 115 WSBool changeuid = FALSE;
175 } else if(vars->Vuserpw) { 170 } else if(vars->Vuserpw) {
176 log_ereport( 171 log_ereport(
177 LOG_WARN, 172 LOG_WARN,
178 "server must be started as root to change uid"); 173 "server must be started as root to change uid");
179 } 174 }
175
176 // run Init directives
177 // this must be done after setuid
178 int err = apply_init_conf(init_config);
179 free_init_conf(init_config);
180 if(err) {
181 log_ereport(LOG_FAILURE, "server init failed");
182 return 1;
183 }
184
185 // init caches
186 auth_cache_init();
187
188 // init SAFs
189 common_saf_init();
180 190
181 191
182 // now that the process is running as the correct user, we can load 192 // now that the process is running as the correct user, we can load
183 // the remaining config 193 // the remaining config
184 if(cfgmgr_apply_config(&mgr)) { 194 if(cfgmgr_apply_config(&mgr)) {

mercurial