summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/printing/spoolssd.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/printing/spoolssd.c b/source3/printing/spoolssd.c
index 00f360f531..b501a33755 100644
--- a/source3/printing/spoolssd.c
+++ b/source3/printing/spoolssd.c
@@ -23,6 +23,20 @@
#define SPOOLSS_PIPE_NAME "spoolss"
+
+static void spoolss_reopen_logs(void)
+{
+ char *lfile = NULL;
+ int ret;
+
+ ret = asprintf(&lfile, "%s.spoolssd", lp_logfile());
+ if (ret > 0) {
+ lp_set_logfile(lfile);
+ SAFE_FREE(lfile);
+ }
+ reopen_logs();
+}
+
void start_spoolssd(void)
{
pid_t pid;
@@ -45,6 +59,8 @@ void start_spoolssd(void)
}
/* child */
+ close_low_fds(false);
+
status = reinit_after_fork(server_messaging_context(),
server_event_context(),
procid_self(), true);
@@ -53,6 +69,8 @@ void start_spoolssd(void)
smb_panic("reinit_after_fork() failed");
}
+ spoolss_reopen_logs();
+
smbd_setup_sig_term_handler();
smbd_setup_sig_hup_handler();