src/server/daemon/webserver.c

changeset 392
0aef555055ee
parent 391
80ee93a7d257
child 415
d938228c382e
equal deleted inserted replaced
391:80ee93a7d257 392:0aef555055ee
67 67
68 int webserver_init() { 68 int webserver_init() {
69 // init NSPR 69 // init NSPR
70 systhread_init("webserver"); 70 systhread_init("webserver");
71 71
72 log_ereport(LOG_VERBOSE, "webserver_init");
73
72 // init ssl 74 // init ssl
73 if(ws_init_ssl()) { 75 if(ws_init_ssl()) {
76 log_ereport(LOG_FAILURE, "ssl init failed");
74 return -1; 77 return -1;
75 } 78 }
76 79
77 // init NSAPI functions 80 // init NSAPI functions
78 pblock_init_default_keys(); 81 pblock_init_default_keys();
80 func_init(); 83 func_init();
81 add_functions(webserver_funcs); 84 add_functions(webserver_funcs);
82 85
83 // init resource pools 86 // init resource pools
84 if(init_resource_pools()) { 87 if(init_resource_pools()) {
88 log_ereport(LOG_FAILURE, "resource pool init failed");
85 return -1; 89 return -1;
86 } 90 }
87 91
88 // load init.conf 92 // load init.conf
89 if(load_init_conf("config/init.conf")) { 93 if(load_init_conf("config/init.conf")) {
97 init_configuration_manager(); 101 init_configuration_manager();
98 CfgManager mgr; 102 CfgManager mgr;
99 if(cfgmgr_load_config(&mgr) != 0) { 103 if(cfgmgr_load_config(&mgr) != 0) {
100 return -1; 104 return -1;
101 } 105 }
106 log_ereport(LOG_VERBOSE, "cfgmgr_load_config stage 1 successful");
102 ServerConfiguration *cfg = mgr.cfg; 107 ServerConfiguration *cfg = mgr.cfg;
103 108
104 // init caches 109 // init caches
105 auth_cache_init(); 110 auth_cache_init();
106 111
173 178
174 179
175 // now that the process is running as the correct user, we can load 180 // now that the process is running as the correct user, we can load
176 // the remaining config 181 // the remaining config
177 if(cfgmgr_apply_config(&mgr)) { 182 if(cfgmgr_apply_config(&mgr)) {
183 log_ereport(LOG_FAILURE, "load config stage 2 failed");
178 return -1; 184 return -1;
179 } 185 }
180 186
181 187
182 // create tmp dir and pid file 188 // create tmp dir and pid file
202 log_ereport( 208 log_ereport(
203 LOG_CATASTROPHE, 209 LOG_CATASTROPHE,
204 "cannot change permissions of tmp dir %s:", 210 "cannot change permissions of tmp dir %s:",
205 tmp_priv.ptr, 211 tmp_priv.ptr,
206 strerror(errno)); 212 strerror(errno));
207 return 0; 213 return -1;
208 } 214 }
209 } else { 215 } else {
210 log_ereport( 216 log_ereport(
211 LOG_CATASTROPHE, 217 LOG_CATASTROPHE,
212 "cannot create tmp dir %s:", 218 "cannot create tmp dir %s:",

mercurial