s3:printing: Initialize the printcap cache as soon as the bgqd starts
authorAndreas Schneider <asn@samba.org>
Mon, 30 May 2022 15:22:21 +0000 (17:22 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 31 May 2022 20:53:35 +0000 (20:53 +0000)
As soon as the background daemon starts, we need to initialize the
printcap cache so that rpcd-spoolssd can serve printers.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15081

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/printing/queue_process.c

index 3b0ef55c3cce62e83250bb0e1799f5bb39c9ca9d..c44f60fa20ea48942a5bfb38e2c38d2d4743e6ea 100644 (file)
@@ -319,6 +319,9 @@ struct bq_state *register_printing_bq_handlers(
                goto fail_free_handlers;
        }
 
+       /* Initialize the printcap cache as soon as the daemon starts. */
+       pcap_cache_reload(state->ev, state->msg, reload_pcap_change_notify);
+
        ok = printing_subsystem_queue_tasks(state);
        if (!ok) {
                goto fail_free_handlers;