--- lbbs/src/net_server.c 2025/11/14 08:45:25 1.82 +++ lbbs/src/net_server.c 2025/11/16 02:06:56 1.84 @@ -393,7 +393,6 @@ static int fork_server(void) } // Redirect Input - close(STDIN_FILENO); if (dup2(socket_client, STDIN_FILENO) == -1) { log_error("Redirect stdin to client socket failed\n"); @@ -401,7 +400,6 @@ static int fork_server(void) } // Redirect Output - close(STDOUT_FILENO); if (dup2(socket_client, STDOUT_FILENO) == -1) { log_error("Redirect stdout to client socket failed\n"); @@ -674,6 +672,12 @@ int net_server(const char *hostaddr, in_ SYS_conf_reload = 0; sd_notify(0, "RELOADING=1"); + // Restart log + if (log_restart() < 0) + { + log_error("Restart logging failed\n"); + } + // Reload configuration if (load_conf(CONF_BBSD) < 0) { @@ -730,6 +734,12 @@ int net_server(const char *hostaddr, in_ log_common("Reload section config and gen_ex successfully\n"); } + // Notify child processes to reload configuration + if (kill(-getpid(), SIGUSR1) < 0) + { + log_error("Send SIGUSR1 signal failed (%d)\n", errno); + } + sd_notify(0, "READY=1"); }