| 3431 | } |
| 3432 | |
| 3433 | static int init(int argc, char **argv) |
| 3434 | { |
| 3435 | char *dbname, *lrlname = NULL, ctmp[64]; |
| 3436 | static int noabort = 0; |
| 3437 | int cacheszkb = 0, ii; |
| 3438 | int rc; |
| 3439 | int bdberr; |
| 3440 | int cacheszkb_suggestion = 0; |
| 3441 | int stripes, blobstripe; |
| 3442 | |
| 3443 | if (argc < 2) { |
| 3444 | print_usage_and_exit(1); |
| 3445 | } |
| 3446 | |
| 3447 | csc2_allow_bools(); |
| 3448 | |
| 3449 | rc = bdb_osql_log_repo_init(&bdberr); |
| 3450 | if (rc) { |
| 3451 | logmsg(LOGMSG_FATAL, "bdb_osql_log_repo_init failed to init log repository " |
| 3452 | "rc %d bdberr %d\n", |
| 3453 | rc, bdberr); |
| 3454 | return -1; |
| 3455 | } |
| 3456 | |
| 3457 | if (thd_init()) { |
| 3458 | logmsg(LOGMSG_FATAL, "failed initialize thread module\n"); |
| 3459 | return -1; |
| 3460 | } |
| 3461 | /* This also initializes the appsock handler hash. */ |
| 3462 | if (appsock_init()) { |
| 3463 | logmsg(LOGMSG_FATAL, "failed initialize appsock module\n"); |
| 3464 | return -1; |
| 3465 | } |
| 3466 | if (sqlpool_init()) { |
| 3467 | logmsg(LOGMSG_FATAL, "failed to initialise sql module\n"); |
| 3468 | return -1; |
| 3469 | } |
| 3470 | if (clnt_stats_init()) { |
| 3471 | logmsg(LOGMSG_FATAL, "failed to initialise connection tracking module\n"); |
| 3472 | return -1; |
| 3473 | } |
| 3474 | if (udppfault_thdpool_init()) { |
| 3475 | logmsg(LOGMSG_FATAL, "failed to initialise udp prefault module\n"); |
| 3476 | return -1; |
| 3477 | } |
| 3478 | if (pgcompact_thdpool_init()) { |
| 3479 | logmsg(LOGMSG_FATAL, "failed to initialise page compact module\n"); |
| 3480 | return -1; |
| 3481 | } |
| 3482 | |
| 3483 | initresourceman(NULL); |
| 3484 | |
| 3485 | /* Initialize the opcode handler hash */ |
| 3486 | if (init_opcode_handlers()) { |
| 3487 | logmsg(LOGMSG_FATAL, "failed to initialise opcode handler hash\n"); |
| 3488 | return -1; |
| 3489 | } |
| 3490 |
no test coverage detected