}
void printing_subsystem_update(struct tevent_context *ev_ctx,
- struct messaging_context *msg_ctx)
+ struct messaging_context *msg_ctx,
+ bool force)
{
- if (background_lpq_updater_pid != -1) return;
+ if (background_lpq_updater_pid != -1) {
+ if (force) {
+ /* Send a sighup to the background process.
+ * this will force it to reload printers */
+ kill(background_lpq_updater_pid, SIGHUP);
+ }
+ return;
+ }
pcap_cache_reload(ev_ctx, msg_ctx, &reload_pcap_change_notify);
}
bool start_daemons,
bool background_queue);
void printing_subsystem_update(struct tevent_context *ev_ctx,
- struct messaging_context *msg_ctx);
+ struct messaging_context *msg_ctx,
+ bool force);
pid_t start_background_queue(struct tevent_context *ev,
struct messaging_context *msg);
DEBUG(1,("Reloading services after SIGHUP\n"));
reload_services(msg_ctx, smbd_server_conn->sock, False);
if (am_parent) {
- printing_subsystem_update(ev, msg_ctx);
+ printing_subsystem_update(ev, msg_ctx, true);
}
}
change_to_root_user();
reload_services(msg, smbd_server_conn->sock, False);
if (am_parent) {
- printing_subsystem_update(ev_ctx, msg);
+ printing_subsystem_update(ev_ctx, msg, false);
}
}
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,
+ * before we allow clients to start connecting */
+ printing_subsystem_update(ev_ctx, msg_ctx, true);
+
TALLOC_FREE(frame);
/* make sure we always have a valid stackframe */
frame = talloc_stackframe();