From 2d333ae8bc42a5aab7df6985b1432e3a480e74dc Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 15 Jun 2010 18:38:44 -0400 Subject: s3:spoolssd Create our own log file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Günther Deschner --- source3/printing/spoolssd.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source3') 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(); -- cgit