| 25 |
#include "login.h" |
#include "login.h" |
| 26 |
#include "menu.h" |
#include "menu.h" |
| 27 |
#include "net_server.h" |
#include "net_server.h" |
| 28 |
|
#include "section_list.h" |
| 29 |
#include "section_list_loader.h" |
#include "section_list_loader.h" |
| 30 |
#include <errno.h> |
#include <errno.h> |
| 31 |
#include <fcntl.h> |
#include <fcntl.h> |
| 407 |
} |
} |
| 408 |
|
|
| 409 |
sd_notifyf(0, "STATUS=Waiting for %d child process to exit", SYS_child_process_count); |
sd_notifyf(0, "STATUS=Waiting for %d child process to exit", SYS_child_process_count); |
| 410 |
|
|
| 411 |
|
sleep(1); // Sleep for a while to avoid notifying child processes too frequently |
| 412 |
} |
} |
| 413 |
|
|
| 414 |
if (SYS_conf_reload && !SYS_server_exit) |
if (SYS_conf_reload && !SYS_server_exit) |
| 429 |
} |
} |
| 430 |
else |
else |
| 431 |
{ |
{ |
| 432 |
|
unload_menu(&bbs_menu); |
| 433 |
memcpy(&bbs_menu, &bbs_menu_new, sizeof(bbs_menu_new)); |
memcpy(&bbs_menu, &bbs_menu_new, sizeof(bbs_menu_new)); |
| 434 |
log_common("Reload menu successfully\n"); |
log_common("Reload menu successfully\n"); |
| 435 |
} |
} |
| 436 |
|
|
|
sd_notify(0, "READY=1"); |
|
|
} |
|
|
|
|
|
if (SYS_data_file_reload && !SYS_server_exit) |
|
|
{ |
|
|
SYS_data_file_reload = 0; |
|
|
sd_notify(0, "RELOADING=1"); |
|
|
|
|
| 437 |
for (int i = 0; i < data_files_load_startup_count; i++) |
for (int i = 0; i < data_files_load_startup_count; i++) |
| 438 |
{ |
{ |
| 439 |
if (load_file(data_files_load_startup[i]) < 0) |
if (load_file(data_files_load_startup[i]) < 0) |
| 441 |
log_error("load_file_mmap(%s) error\n", data_files_load_startup[i]); |
log_error("load_file_mmap(%s) error\n", data_files_load_startup[i]); |
| 442 |
} |
} |
| 443 |
} |
} |
|
|
|
| 444 |
log_common("Reload data files successfully\n"); |
log_common("Reload data files successfully\n"); |
|
sd_notify(0, "READY=1"); |
|
|
} |
|
|
|
|
|
if (SYS_section_list_reload && !SYS_server_exit) |
|
|
{ |
|
|
SYS_section_list_reload = 0; |
|
| 445 |
|
|
| 446 |
if (section_list_loader_reload() < 0) |
// Load section config and gen_ex |
| 447 |
|
if (load_section_config_from_db(1) < 0) |
| 448 |
|
{ |
| 449 |
|
log_error("load_section_config_from_db(1) error\n"); |
| 450 |
|
} |
| 451 |
|
else |
| 452 |
{ |
{ |
| 453 |
log_error("section_list_loader_reload() failed\n"); |
log_common("Reload section config and gen_ex successfully\n"); |
| 454 |
} |
} |
| 455 |
|
|
| 456 |
|
sd_notify(0, "READY=1"); |
| 457 |
} |
} |
| 458 |
|
|
| 459 |
nfds = epoll_wait(epollfd, events, MAX_EVENTS, 100); // 0.1 second |
nfds = epoll_wait(epollfd, events, MAX_EVENTS, 100); // 0.1 second |