s3:server Consolidate printing related initialization
authorSimo Sorce <idra@samba.org>
Tue, 2 Aug 2011 14:06:31 +0000 (10:06 -0400)
committerGünther Deschner <gd@samba.org>
Tue, 2 Aug 2011 15:37:44 +0000 (17:37 +0200)
Signed-off-by: Günther Deschner <gd@samba.org>
Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Tue Aug  2 17:37:44 CEST 2011 on sn-devel-104

source3/printing/printing.c
source3/printing/queue_process.c
source3/smbd/server.c

index f1e2aeb265ea756bada686d68946bfc4a2159a60..ac9e76809290fe9f887b9e88de4ef0e6ba220faf 100644 (file)
@@ -28,6 +28,7 @@
 #include "../librpc/gen_ndr/netlogon.h"
 #include "printing/notify.h"
 #include "printing/pcap.h"
+#include "printing/printer_list.h"
 #include "printing/queue_process.h"
 #include "serverid.h"
 #include "smbd/smbd.h"
@@ -197,6 +198,10 @@ bool print_backend_init(struct messaging_context *msg_ctx)
        int services = lp_numservices();
        int snum;
 
+       if (!printer_list_parent_init()) {
+               return false;
+       }
+
        unlink(cache_path("printing.tdb"));
        mkdir(cache_path("printing"),0755);
 
index 9fbdd811ab5f0367f8e0b531c03ed23444e84ae8..791f2d7a33b33df44c7ad67437eda9898401f9fe 100644 (file)
@@ -273,6 +273,10 @@ bool printing_subsystem_init(struct tevent_context *ev_ctx,
 
        use_background_queue = background_queue;
 
+       if (!print_backend_init(msg_ctx)) {
+               return false;
+       }
+
        /* Publish nt printers, this requires a working winreg pipe */
        pcap_cache_reload(ev_ctx, msg_ctx, &reload_printers);
 
index 16395ee3dd476943e984db4c2298cb09fc4e889e..8aa4f5f0934a00b1141580928533a6c561327f90 100644 (file)
 #include "secrets.h"
 #include "memcache.h"
 #include "ctdbd_conn.h"
-#include "printing/printer_list.h"
 #include "printing/queue_process.h"
 #include "rpc_server/rpc_service_setup.h"
-#include "printing.h"
 #include "serverid.h"
 #include "passdb.h"
 #include "auth.h"
@@ -1173,16 +1171,9 @@ extern void build_options(bool screen);
                exit(1);
        }
 
-       if (!printer_list_parent_init()) {
-               exit(1);
-       }
-
        if (!W_ERROR_IS_OK(registry_init_full()))
                exit(1);
 
-       if (!print_backend_init(msg_ctx))
-               exit(1);
-
        /* Open the share_info.tdb here, so we don't have to open
           after the fork on every single connection.  This is a small
           performance improvment and reduces the total number of system