| 222 |
goto cleanup; |
goto cleanup; |
| 223 |
} |
} |
| 224 |
|
|
| 225 |
// Load section config |
set_last_article_op_log_from_db(); |
| 226 |
|
|
| 227 |
|
// Load section articles |
| 228 |
if (append_articles_from_db(0, 1) < 0) |
if (append_articles_from_db(0, 1) < 0) |
| 229 |
{ |
{ |
| 230 |
log_error("append_articles_from_db(0, 1) error\n"); |
log_error("append_articles_from_db(0, 1) error\n"); |
| 231 |
goto cleanup; |
goto cleanup; |
| 232 |
} |
} |
| 233 |
|
|
| 234 |
log_std("Debug: last_aid = %d\n", article_block_last_aid()); |
log_std("Initially load %d articles, last_aid = %d\n", article_block_article_count(), article_block_last_aid()); |
| 235 |
|
|
| 236 |
// Set signal handler |
// Set signal handler |
| 237 |
signal(SIGHUP, sig_hup_handler); |
signal(SIGHUP, sig_hup_handler); |
| 238 |
signal(SIGCHLD, sig_chld_handler); |
signal(SIGCHLD, sig_chld_handler); |
| 239 |
signal(SIGTERM, sig_term_handler); |
signal(SIGTERM, sig_term_handler); |
| 240 |
|
|
| 241 |
|
// Launch section_list_loader process |
| 242 |
|
if (section_list_loader_launch() < 0) |
| 243 |
|
{ |
| 244 |
|
log_error("section_list_loader_launch() error\n"); |
| 245 |
|
goto cleanup; |
| 246 |
|
} |
| 247 |
|
|
| 248 |
// Initialize socket server |
// Initialize socket server |
| 249 |
net_server(BBS_address, BBS_port); |
net_server(BBS_address, BBS_port); |
| 250 |
|
|