summaryrefslogtreecommitdiff
path: root/source3/printing/queue_process.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/printing/queue_process.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/printing/queue_process.c')
-rw-r--r--source3/printing/queue_process.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/source3/printing/queue_process.c b/source3/printing/queue_process.c
index 2b15c36404..5d18a08d63 100644
--- a/source3/printing/queue_process.c
+++ b/source3/printing/queue_process.c
@@ -29,6 +29,10 @@
#include "serverid.h"
#include "locking/proto.h"
#include "smbd/proto.h"
+#include "rpc_server/rpc_service_setup.h"
+
+extern pid_t start_spoolssd(struct event_context *ev_ctx,
+ struct messaging_context *msg_ctx);
/****************************************************************************
Notify smbds of new printcap data
@@ -222,7 +226,6 @@ pid_t start_background_queue(struct tevent_context *ev,
if (!locking_init()) {
exit(1);
}
-
messaging_register(msg_ctx, ev, MSG_SMB_CONF_UPDATED,
bq_smb_conf_updated);
messaging_register(msg_ctx, NULL, MSG_PRINTER_UPDATE,
@@ -252,15 +255,23 @@ pid_t start_background_queue(struct tevent_context *ev,
/* Run before the parent forks */
bool printing_subsystem_init(struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
+ bool start_daemons,
bool background_queue)
{
+ enum rpc_service_mode_e spoolss_mode = rpc_spoolss_mode();
pid_t pid = -1;
if (!print_backend_init(msg_ctx)) {
return false;
}
- if (background_queue) {
+ /* start spoolss daemon */
+ /* start as a separate daemon only if enabled */
+ if (start_daemons && spoolss_mode == RPC_SERVICE_MODE_DAEMON) {
+
+ pid = start_spoolssd(ev_ctx, msg_ctx);
+
+ } else if (start_daemons && background_queue) {
pid = start_background_queue(ev_ctx, msg_ctx);