s3-printing: Do not try to force reload.
authorSimo Sorce <idra@samba.org>
Wed, 10 Aug 2011 13:27:24 +0000 (09:27 -0400)
committerAndreas Schneider <asn@samba.org>
Wed, 10 Aug 2011 16:14:06 +0000 (18:14 +0200)
Be more correct in load printers at startup.
If async process have already started we do not need to force a reload, but we
just need to load the printers. If other process have not finished initializing
it makes no sense to try to force them as they are masking SIGHUP unitl init is
done anyway.

Signed-off-by: Andreas Schneider <asn@samba.org>
source3/printing/queue_process.c
source3/smbd/server.c

index 20f1a5b06b4969dc43b1f2269e32264327084638..fd4f3c72850f36f802db822bda58d7e8f2285c4f 100644 (file)
@@ -30,6 +30,7 @@
 #include "locking/proto.h"
 #include "smbd/proto.h"
 #include "rpc_server/rpc_service_setup.h"
+#include "printing/load.h"
 
 extern pid_t start_spoolssd(struct event_context *ev_ctx,
                            struct messaging_context *msg_ctx);
@@ -357,6 +358,9 @@ void printing_subsystem_update(struct tevent_context *ev_ctx,
                               bool force)
 {
        if (background_lpq_updater_pid != -1) {
+               if (pcap_cache_loaded()) {
+                       load_printers(ev_ctx, msg_ctx);
+               }
                if (force) {
                        /* Send a sighup to the background process.
                         * this will force it to reload printers */
@@ -365,5 +369,5 @@ void printing_subsystem_update(struct tevent_context *ev_ctx,
                return;
        }
 
-       pcap_cache_reload(ev_ctx, msg_ctx, &reload_pcap_change_notify);
+       pcap_cache_reload(ev_ctx, msg_ctx, &reload_printers);
 }
index 24d61483e25b0244ecc8b4920bfc3d2dd8793aaf..d396289e0d5d6df94c4dada8d1b36623b0c52ed6 100644 (file)
@@ -1260,9 +1260,9 @@ extern void build_options(bool screen);
        if (!open_sockets_smbd(parent, ev_ctx, msg_ctx, ports))
                exit_server("open_sockets_smbd() failed");
 
-       /* force a printer update now that all messaging has been set up,
+       /* do a printer update now that all messaging has been set up,
         * before we allow clients to start connecting */
-       printing_subsystem_update(ev_ctx, msg_ctx, true);
+       printing_subsystem_update(ev_ctx, msg_ctx, false);
 
        TALLOC_FREE(frame);
        /* make sure we always have a valid stackframe */