#include "param/param.h"
#include "ldb_wrap.h"
#include "lib/messaging/messaging.h"
+#include "lib/util/debug.h"
struct standard_child_state {
const char *name;
}
}
+static void sighup_signal_handler(struct tevent_context *ev,
+ struct tevent_signal *se,
+ int signum, int count, void *siginfo,
+ void *private_data)
+{
+ debug_schedule_reopen_logs();
+}
+
/*
handle EOF on the parent-to-all-children pipe in the child
*/
struct socket_address *c, *s;
struct standard_child_state *state;
struct tevent_fd *fde = NULL;
+ struct tevent_signal *se = NULL;
state = setup_standard_child_pipe(ev, NULL);
if (state == NULL) {
child_pipe[1] = -1;
}
+ se = tevent_add_signal(ev,
+ ev,
+ SIGHUP,
+ 0,
+ sighup_signal_handler,
+ NULL);
+ if (se == NULL) {
+ smb_panic("Failed to add SIGHUP handler after fork");
+ }
+
/* setup the process title */
c = socket_get_peer_addr(sock2, ev);
s = socket_get_my_addr(sock2, ev);
NTSTATUS status;
struct standard_child_state *state;
struct tevent_fd *fde = NULL;
+ struct tevent_signal *se = NULL;
state = setup_standard_child_pipe(ev, service_name);
if (state == NULL) {
child_pipe[1] = -1;
}
+ se = tevent_add_signal(ev,
+ ev,
+ SIGHUP,
+ 0,
+ sighup_signal_handler,
+ NULL);
+ if (se == NULL) {
+ smb_panic("Failed to add SIGHUP handler after fork");
+ }
+
setproctitle("task %s server_id[%d]", service_name, (int)pid);
/* setup this new task. Cluster ID is PID based for this process model */