| 16 |
***************************************************************************/ |
***************************************************************************/ |
| 17 |
|
|
| 18 |
#include "bbs.h" |
#include "bbs.h" |
| 19 |
|
#include "init.h" |
| 20 |
#include "common.h" |
#include "common.h" |
| 21 |
|
#include "net_server.h" |
| 22 |
|
#include "log.h" |
| 23 |
#include "io.h" |
#include "io.h" |
| 24 |
#include "menu.h" |
#include "menu.h" |
| 25 |
|
#include <stdlib.h> |
| 26 |
#include <signal.h> |
#include <signal.h> |
| 27 |
#include <string.h> |
#include <string.h> |
|
#include <sys/types.h> |
|
| 28 |
#include <unistd.h> |
#include <unistd.h> |
| 29 |
|
#include <sys/types.h> |
| 30 |
|
#include <sys/stat.h> |
| 31 |
|
|
| 32 |
void app_help(void) |
void app_help(void) |
| 33 |
{ |
{ |
| 111 |
|
|
| 112 |
// Initialize daemon |
// Initialize daemon |
| 113 |
if (daemon) |
if (daemon) |
| 114 |
|
{ |
| 115 |
init_daemon(); |
init_daemon(); |
| 116 |
|
} |
| 117 |
|
|
| 118 |
// Change current dir |
// Change current dir |
| 119 |
strncpy(app_home_dir, argv[0], rindex(argv[0], '/') - argv[0] + 1); |
strncpy(app_home_dir, argv[0], strrchr(argv[0], '/') - argv[0] + 1); |
| 120 |
strcat(app_home_dir, "../"); |
strcat(app_home_dir, "../"); |
| 121 |
chdir(app_home_dir); |
chdir(app_home_dir); |
| 122 |
|
|
| 123 |
// Initialize log |
// Initialize log |
| 124 |
strcpy(app_temp_dir, "/tmp/lbbs/"); |
strcpy(app_temp_dir, "var/"); |
| 125 |
mkdir(app_temp_dir, 0777); |
mkdir(app_temp_dir, 0750); |
| 126 |
strcpy(log_dir, app_home_dir); |
strcpy(log_dir, app_home_dir); |
| 127 |
strcat(log_dir, "log/"); |
strcat(log_dir, "log/"); |
| 128 |
strcpy(file_log_std, log_dir); |
strcpy(file_log_std, log_dir); |