private_data, struct messaging_context);
DEBUG(1,("Reloading printers after SIGHUP\n"));
- reload_pcap_change_notify(ev, msg_ctx);
+ pcap_cache_reload(ev, msg_ctx,
+ &reload_pcap_change_notify);
}
+static void printing_conf_updated(struct messaging_context *msg,
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id server_id,
+ DATA_BLOB *data)
+{
+ DEBUG(5,("Reloading printers after conf change\n"));
+ pcap_cache_reload(messaging_event_context(msg), msg,
+ &reload_pcap_change_notify);
+}
+
+
static pid_t background_lpq_updater_pid = -1;
/****************************************************************************
messaging_register(msg_ctx, NULL, MSG_PRINTER_UPDATE,
print_queue_receive);
+ messaging_register(msg_ctx, NULL, MSG_SMB_CONF_UPDATED,
+ printing_conf_updated);
fde = tevent_add_fd(ev, ev, pause_pipe[1], TEVENT_FD_READ,
printing_pause_fd_handler,
return result;
}
-static void smbd_sig_term_handler(struct tevent_context *ev,
- struct tevent_signal *se,
- int signum,
- int count,
- void *siginfo,
- void *private_data)
-{
- exit_server_cleanly("termination signal");
-}
-
-void smbd_setup_sig_term_handler(void)
-{
- struct tevent_signal *se;
-
- se = tevent_add_signal(smbd_event_context(),
- smbd_event_context(),
- SIGTERM, 0,
- smbd_sig_term_handler,
- NULL);
- if (!se) {
- exit_server("failed to setup SIGTERM handler");
- }
-}
-
-static void smbd_sig_hup_handler(struct tevent_context *ev,
- struct tevent_signal *se,
- int signum,
- int count,
- void *siginfo,
- void *private_data)
-{
- struct messaging_context *msg_ctx = talloc_get_type_abort(
- private_data, struct messaging_context);
- change_to_root_user();
- DEBUG(1,("Reloading services after SIGHUP\n"));
- reload_services(msg_ctx, smbd_server_conn->sock, False);
-}
-
-void smbd_setup_sig_hup_handler(struct tevent_context *ev,
- struct messaging_context *msg_ctx)
-{
- struct tevent_signal *se;
-
- se = tevent_add_signal(ev, ev, SIGHUP, 0, smbd_sig_hup_handler,
- msg_ctx);
- if (!se) {
- exit_server("failed to setup SIGHUP handler");
- }
-}
-
static NTSTATUS smbd_server_connection_loop_once(struct smbd_server_connection *conn)
{
int timeout;
/* The following definitions come from smbd/process.c */
-void smbd_setup_sig_term_handler(void);
bool srv_send_smb(struct smbd_server_connection *sconn, char *buffer,
bool no_signing, uint32_t seqnum,
bool do_encrypt,
"updated. Reloading.\n"));
change_to_root_user();
reload_services(msg, smbd_server_conn->sock, False);
- reload_printers(ev_ctx, msg);
+ /* printer reload triggered by background printing process */
}
/*******************************************************************
reload_printers(ev_ctx, msg);
}
+static void smbd_sig_term_handler(struct tevent_context *ev,
+ struct tevent_signal *se,
+ int signum,
+ int count,
+ void *siginfo,
+ void *private_data)
+{
+ exit_server_cleanly("termination signal");
+}
+
+static void smbd_setup_sig_term_handler(void)
+{
+ struct tevent_signal *se;
+
+ se = tevent_add_signal(smbd_event_context(),
+ smbd_event_context(),
+ SIGTERM, 0,
+ smbd_sig_term_handler,
+ NULL);
+ if (!se) {
+ exit_server("failed to setup SIGTERM handler");
+ }
+}
+
+static void smbd_sig_hup_handler(struct tevent_context *ev,
+ struct tevent_signal *se,
+ int signum,
+ int count,
+ void *siginfo,
+ void *private_data)
+{
+ struct messaging_context *msg_ctx = talloc_get_type_abort(
+ private_data, struct messaging_context);
+ change_to_root_user();
+ DEBUG(1,("Reloading services after SIGHUP\n"));
+ reload_services(msg_ctx, smbd_server_conn->sock, false);
+}
+
+static void smbd_setup_sig_hup_handler(struct tevent_context *ev,
+ struct messaging_context *msg_ctx)
+{
+ struct tevent_signal *se;
+
+ se = tevent_add_signal(ev, ev, SIGHUP, 0, smbd_sig_hup_handler,
+ msg_ctx);
+ if (!se) {
+ exit_server("failed to setup SIGHUP handler");
+ }
+}
+
+
/*******************************************************************
Delete a statcache entry.
********************************************************************/