| 393 |
} |
} |
| 394 |
|
|
| 395 |
// Redirect Input |
// Redirect Input |
|
close(STDIN_FILENO); |
|
| 396 |
if (dup2(socket_client, STDIN_FILENO) == -1) |
if (dup2(socket_client, STDIN_FILENO) == -1) |
| 397 |
{ |
{ |
| 398 |
log_error("Redirect stdin to client socket failed\n"); |
log_error("Redirect stdin to client socket failed\n"); |
| 400 |
} |
} |
| 401 |
|
|
| 402 |
// Redirect Output |
// Redirect Output |
|
close(STDOUT_FILENO); |
|
| 403 |
if (dup2(socket_client, STDOUT_FILENO) == -1) |
if (dup2(socket_client, STDOUT_FILENO) == -1) |
| 404 |
{ |
{ |
| 405 |
log_error("Redirect stdout to client socket failed\n"); |
log_error("Redirect stdout to client socket failed\n"); |
| 672 |
SYS_conf_reload = 0; |
SYS_conf_reload = 0; |
| 673 |
sd_notify(0, "RELOADING=1"); |
sd_notify(0, "RELOADING=1"); |
| 674 |
|
|
| 675 |
|
// Restart log |
| 676 |
|
if (log_restart() < 0) |
| 677 |
|
{ |
| 678 |
|
log_error("Restart logging failed\n"); |
| 679 |
|
} |
| 680 |
|
|
| 681 |
// Reload configuration |
// Reload configuration |
| 682 |
if (load_conf(CONF_BBSD) < 0) |
if (load_conf(CONF_BBSD) < 0) |
| 683 |
{ |
{ |
| 734 |
log_common("Reload section config and gen_ex successfully\n"); |
log_common("Reload section config and gen_ex successfully\n"); |
| 735 |
} |
} |
| 736 |
|
|
| 737 |
|
// Notify child processes to reload configuration |
| 738 |
|
if (kill(-getpid(), SIGUSR1) < 0) |
| 739 |
|
{ |
| 740 |
|
log_error("Send SIGUSR1 signal failed (%d)\n", errno); |
| 741 |
|
} |
| 742 |
|
|
| 743 |
sd_notify(0, "READY=1"); |
sd_notify(0, "READY=1"); |
| 744 |
} |
} |
| 745 |
|
|