static int spoolss_max_children;
static int spoolss_spawn_rate;
static int spoolss_prefork_status;
+static int spoolss_child_id = 0;
static void spoolss_prefork_config(void)
{
lp_load(get_dyn_CONFIGFILE(), true, false, false, true);
reload_printers(ev, msg);
- spoolss_reopen_logs(0);
- spoolss_prefork_config();
+ spoolss_reopen_logs(spoolss_child_id);
+ if (spoolss_child_id == 0) {
+ spoolss_prefork_config();
+ }
}
static void smb_conf_updated(struct messaging_context *msg,
struct spoolss_chld_sig_hup_ctx {
struct messaging_context *msg_ctx;
struct pf_worker_data *pf;
- int child_id;
};
static void spoolss_chld_sig_hup_handler(struct tevent_context *ev,
change_to_root_user();
DEBUG(1,("Reloading printers after SIGHUP\n"));
reload_printers(ev, shc->msg_ctx);
- spoolss_reopen_logs(shc->child_id);
+ spoolss_reopen_logs(spoolss_child_id);
}
static bool spoolss_setup_chld_hup_handler(struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
- struct pf_worker_data *pf,
- int child_id)
+ struct pf_worker_data *pf)
{
struct spoolss_chld_sig_hup_ctx *shc;
struct tevent_signal *se;
DEBUG(1, ("failed to setup SIGHUP handler"));
return false;
}
- shc->child_id = child_id;
shc->pf = pf;
shc->msg_ctx = msg_ctx;
smb_panic("reinit_after_fork() failed");
}
+ spoolss_child_id = child_id;
spoolss_reopen_logs(child_id);
- ok = spoolss_setup_chld_hup_handler(ev_ctx, msg_ctx, pf, child_id);
+ ok = spoolss_setup_chld_hup_handler(ev_ctx, msg_ctx, pf);
if (!ok) {
return false;
}
struct spoolss_children_data {
struct tevent_context *ev_ctx;
struct messaging_context *msg_ctx;
- int child_id;
struct pf_worker_data *pf;
int listen_fd_size;
int *listen_fds;
if (!data) {
return 1;
}
- data->child_id = child_id;
data->pf = pf;
data->ev_ctx = ev_ctx;
data->msg_ctx = msg_ctx;