summaryrefslogtreecommitdiff
path: root/source3/smbd/server.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2011-05-18 11:24:30 -0400
committerAndreas Schneider <asn@samba.org>2011-08-10 18:14:04 +0200
commitd36a8dc896d2a814dd18f127593a8382e4004213 (patch)
treebd723ae77ea5dc32fe7d9da08a2f26226f13dd23 /source3/smbd/server.c
parent9ce64166731dcacf7e2774380fe58ec780568d2e (diff)
downloadsamba-d36a8dc896d2a814dd18f127593a8382e4004213.tar.gz
samba-d36a8dc896d2a814dd18f127593a8382e4004213.tar.bz2
samba-d36a8dc896d2a814dd18f127593a8382e4004213.zip
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 <asn@samba.org>
Diffstat (limited to 'source3/smbd/server.c')
-rw-r--r--source3/smbd/server.c30
1 files changed, 8 insertions, 22 deletions
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);