From 84a3bfdc126cefc54168bfad120b2b4530a4b5df Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 23 Oct 2025 10:49:31 +0200 Subject: [PATCH] s3:printing: Load the shares for [printers] in samba-bgqd One of the main functions of bgqd is: delete_and_reload_printers_full() It isn't able to do its work, if we don't load the shares. Normally bgqd was forked from smbd and this loaded the shares. But with the introduction of samba-dcerpcd it is a standalone service now. As a standalone service it is responsible to load the shares if it needs to work on them. The following message is printed if delete_and_reload_printers_full() tries to do its job: [2025/10/23 09:57:27, 7, pid=41935, effective(0, 0), real(0, 0)] ../../source3/param/loadparm.c:4419(lp_servicenumber) lp_servicenumber: couldn't find printers [2025/10/23 09:57:27, 7, pid=41935, effective(0, 0), real(0, 0)] ../../source3/param/loadparm.c:4419(lp_servicenumber) lp_servicenumber: couldn't find printers BUG: https://bugzilla.samba.org/show_bug.cgi?id=15936 Signed-off-by: Andreas Schneider Reviewed-by: Anoop C S (cherry picked from commit 327e60adf2e1e0c040bd32c748fbabc9e4a3593b) --- source3/printing/queue_process.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source3/printing/queue_process.c b/source3/printing/queue_process.c index 0f95bd736f2..51eafa31572 100644 --- a/source3/printing/queue_process.c +++ b/source3/printing/queue_process.c @@ -265,6 +265,7 @@ static void bq_smb_conf_updated(struct messaging_context *msg_ctx, DEBUG(10,("smb_conf_updated: Got message saying smb.conf was " "updated. Reloading.\n")); change_to_root_user(); + lp_load_with_shares(get_dyn_CONFIGFILE()); pcap_cache_reload(state->ev, msg_ctx, reload_pcap_change_notify); printing_subsystem_queue_tasks(state); } @@ -322,6 +323,8 @@ struct bq_state *register_printing_bq_handlers( goto fail_free_handlers; } + /* Load shares, needed for [printers] */ + lp_load_with_shares(get_dyn_CONFIGFILE()); /* Initialize the printcap cache as soon as the daemon starts. */ pcap_cache_reload(state->ev, state->msg, reload_pcap_change_notify); -- 2.51.1