| 78 |
app_help(); |
app_help(); |
| 79 |
return 0; |
return 0; |
| 80 |
case 'v': |
case 'v': |
| 81 |
puts(app_version); |
puts(APP_NAME_VER); |
| 82 |
return 0; |
return 0; |
| 83 |
default: |
default: |
| 84 |
arg_error(); |
arg_error(); |
| 100 |
} |
} |
| 101 |
if (strcmp(argv[i] + 2, "version") == 0) |
if (strcmp(argv[i] + 2, "version") == 0) |
| 102 |
{ |
{ |
| 103 |
puts(app_version); |
puts(APP_NAME_VER); |
| 104 |
return 0; |
return 0; |
| 105 |
} |
} |
| 106 |
if (strcmp(argv[i] + 2, "display-log") == 0) |
if (strcmp(argv[i] + 2, "display-log") == 0) |
| 137 |
|
|
| 138 |
if ((!daemon) && std_log_redir) |
if ((!daemon) && std_log_redir) |
| 139 |
{ |
{ |
| 140 |
log_std_redirect(STDERR_FILENO); |
log_common_redir(STDERR_FILENO); |
| 141 |
} |
} |
| 142 |
if ((!daemon) && error_log_redir) |
if ((!daemon) && error_log_redir) |
| 143 |
{ |
{ |
| 144 |
log_err_redirect(STDERR_FILENO); |
log_error_redir(STDERR_FILENO); |
| 145 |
} |
} |
| 146 |
|
|
| 147 |
|
log_common("BBS Server (%s) is staring...\n", APP_NAME_VER); |
| 148 |
|
|
| 149 |
// Load configuration |
// Load configuration |
| 150 |
if (load_conf(CONF_BBSD) < 0) |
if (load_conf(CONF_BBSD) < 0) |
| 151 |
{ |
{ |
| 250 |
last_aid = article_block_last_aid(); |
last_aid = article_block_last_aid(); |
| 251 |
} while (ret == LOAD_ARTICLE_COUNT_LIMIT); |
} while (ret == LOAD_ARTICLE_COUNT_LIMIT); |
| 252 |
|
|
| 253 |
log_std("Initially load %d articles, last_aid = %d\n", article_block_article_count(), article_block_last_aid()); |
log_common("Initially load %d articles, last_aid = %d\n", article_block_article_count(), article_block_last_aid()); |
| 254 |
|
|
| 255 |
// Set signal handler |
// Set signal handler |
| 256 |
signal(SIGHUP, sig_hup_handler); |
signal(SIGHUP, sig_hup_handler); |
| 294 |
log_error("unlink(%s) error\n", VAR_SECTION_LIST_SHM); |
log_error("unlink(%s) error\n", VAR_SECTION_LIST_SHM); |
| 295 |
} |
} |
| 296 |
|
|
| 297 |
log_std("Main process exit normally\n"); |
log_common("Main process exit normally\n"); |
| 298 |
|
|
| 299 |
return 0; |
return 0; |
| 300 |
} |
} |