From d36a8dc896d2a814dd18f127593a8382e4004213 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 18 May 2011 11:24:30 -0400 Subject: s3:spoolssd Start spoolssd from printing_subsystem_init Use a child for the background updater process Forward printer update messages from spoolss to background update process. Signed-off-by: Andreas Schneider --- source3/smbd/server.c | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) (limited to 'source3/smbd/server.c') diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 9e17e07a41..ee406fdfaf 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -42,9 +42,6 @@ extern void start_epmd(struct tevent_context *ev_ctx, struct messaging_context *msg_ctx); -extern void start_spoolssd(struct event_context *ev_ctx, - struct messaging_context *msg_ctx); - #ifdef WITH_DFS extern int dcelogin_atmost_once; #endif /* WITH_DFS */ @@ -1212,32 +1209,21 @@ extern void build_options(bool screen); exit(1); } - /* only start the background queue daemon if we are - running as a daemon -- bad things will happen if - smbd is launched via inetd and we fork a copy of - ourselves here */ + /* only start other daemons if we are running as a daemon + * -- bad things will happen if smbd is launched via inetd + * and we fork a copy of ourselves here */ + if (is_daemon && !interactive && !_lp_disable_spoolss()) { + bool bgq = lp_parm_bool(-1, "smbd", "backgroundqueue", true); - if (is_daemon && !interactive - && lp_parm_bool(-1, "smbd", "backgroundqueue", true)) { - if (!printing_subsystem_init(ev_ctx, msg_ctx, true)) { + if (!printing_subsystem_init(ev_ctx, msg_ctx, true, bgq)) { exit(1); } - } else { - if (!printing_subsystem_init(ev_ctx, msg_ctx, false)) { + } else if (!_lp_disable_spoolss()) { + if (!printing_subsystem_init(ev_ctx, msg_ctx, false, false)) { exit(1); } } - if (is_daemon && !_lp_disable_spoolss()) { - enum rpc_service_mode_e spoolss_mode = rpc_spoolss_mode(); - - /* start spoolss daemon */ - /* start as a separate daemon only if enabled */ - if (spoolss_mode == RPC_SERVICE_MODE_DAEMON) { - start_spoolssd(ev_ctx, msg_ctx); - } - } - if (!is_daemon) { /* inetd mode */ TALLOC_FREE(frame); -- cgit