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")) { |
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 |