mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s3: Pass the new server_id through reinit_after_fork
This commit is contained in:
parent
5a3c64668a
commit
7f0e6df883
@ -1226,8 +1226,9 @@ ssize_t write_data_at_offset(int fd, const char *buffer, size_t N, SMB_OFF_T pos
|
||||
int set_blocking(int fd, bool set);
|
||||
void smb_msleep(unsigned int t);
|
||||
NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx,
|
||||
struct event_context *ev_ctx,
|
||||
bool parent_longlived);
|
||||
struct event_context *ev_ctx,
|
||||
struct server_id id,
|
||||
bool parent_longlived);
|
||||
void *malloc_(size_t size);
|
||||
void *memalign_array(size_t el_size, size_t align, unsigned int count);
|
||||
void *calloc_array(size_t size, size_t nmemb);
|
||||
|
@ -873,6 +873,7 @@ void smb_msleep(unsigned int t)
|
||||
|
||||
NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx,
|
||||
struct event_context *ev_ctx,
|
||||
struct server_id id,
|
||||
bool parent_longlived)
|
||||
{
|
||||
NTSTATUS status = NT_STATUS_OK;
|
||||
@ -899,7 +900,7 @@ NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx,
|
||||
* For clustering, we need to re-init our ctdbd connection after the
|
||||
* fork
|
||||
*/
|
||||
status = messaging_reinit(msg_ctx, procid_self());
|
||||
status = messaging_reinit(msg_ctx, id);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0,("messaging_reinit() failed: %s\n",
|
||||
nt_errstr(status)));
|
||||
|
@ -137,6 +137,7 @@ void kill_async_dns_child(void)
|
||||
void start_async_dns(void)
|
||||
{
|
||||
int fd1[2], fd2[2];
|
||||
NTSTATUS status;
|
||||
|
||||
CatchChild();
|
||||
|
||||
@ -164,8 +165,11 @@ void start_async_dns(void)
|
||||
CatchSignal(SIGHUP, SIG_IGN);
|
||||
CatchSignal(SIGTERM, sig_term);
|
||||
|
||||
if (!NT_STATUS_IS_OK(reinit_after_fork(nmbd_messaging_context(),
|
||||
nmbd_event_context(), true))) {
|
||||
status = reinit_after_fork(nmbd_messaging_context(),
|
||||
nmbd_event_context(),
|
||||
procid_self(), true);
|
||||
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0,("reinit_after_fork() failed\n"));
|
||||
smb_panic("reinit_after_fork() failed");
|
||||
}
|
||||
|
@ -779,6 +779,7 @@ static bool open_sockets(bool isdaemon, int port)
|
||||
{ NULL }
|
||||
};
|
||||
TALLOC_CTX *frame = talloc_stackframe(); /* Setup tos. */
|
||||
NTSTATUS status;
|
||||
|
||||
load_case_tables();
|
||||
|
||||
@ -923,8 +924,11 @@ static bool open_sockets(bool isdaemon, int port)
|
||||
|
||||
pidfile_create("nmbd");
|
||||
|
||||
if (!NT_STATUS_IS_OK(reinit_after_fork(nmbd_messaging_context(),
|
||||
nmbd_event_context(), false))) {
|
||||
status = reinit_after_fork(nmbd_messaging_context(),
|
||||
nmbd_event_context(),
|
||||
procid_self(), false);
|
||||
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0,("reinit_after_fork() failed\n"));
|
||||
exit(1);
|
||||
}
|
||||
|
@ -397,6 +397,7 @@ static bool cups_pcap_load_async(int *pfd)
|
||||
{
|
||||
int fds[2];
|
||||
pid_t pid;
|
||||
NTSTATUS status;
|
||||
|
||||
*pfd = -1;
|
||||
|
||||
@ -434,8 +435,10 @@ static bool cups_pcap_load_async(int *pfd)
|
||||
|
||||
close_all_print_db();
|
||||
|
||||
if (!NT_STATUS_IS_OK(reinit_after_fork(server_messaging_context(),
|
||||
server_event_context(), true))) {
|
||||
status = reinit_after_fork(server_messaging_context(),
|
||||
server_event_context(), procid_self(),
|
||||
true);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0,("cups_pcap_load_async: reinit_after_fork() failed\n"));
|
||||
smb_panic("cups_pcap_load_async: reinit_after_fork() failed");
|
||||
}
|
||||
|
@ -1430,6 +1430,7 @@ void start_background_queue(void)
|
||||
if(background_lpq_updater_pid == 0) {
|
||||
struct tevent_fd *fde;
|
||||
int ret;
|
||||
NTSTATUS status;
|
||||
|
||||
/* Child. */
|
||||
DEBUG(5,("start_background_queue: background LPQ thread started\n"));
|
||||
@ -1437,9 +1438,11 @@ void start_background_queue(void)
|
||||
close(pause_pipe[0]);
|
||||
pause_pipe[0] = -1;
|
||||
|
||||
if (!NT_STATUS_IS_OK(reinit_after_fork(server_messaging_context(),
|
||||
server_event_context(),
|
||||
true))) {
|
||||
status = reinit_after_fork(server_messaging_context(),
|
||||
server_event_context(),
|
||||
procid_self(), true);
|
||||
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0,("reinit_after_fork() failed\n"));
|
||||
smb_panic("reinit_after_fork() failed");
|
||||
}
|
||||
|
@ -2807,7 +2807,8 @@ static bool fork_echo_handler(struct smbd_server_connection *sconn)
|
||||
close(listener_pipe[0]);
|
||||
|
||||
status = reinit_after_fork(smbd_messaging_context(),
|
||||
smbd_event_context(), false);
|
||||
smbd_event_context(),
|
||||
procid_self(), false);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(1, ("reinit_after_fork failed: %s\n",
|
||||
nt_errstr(status)));
|
||||
|
@ -409,7 +409,8 @@ static void smbd_accept_connection(struct tevent_context *ev,
|
||||
s = NULL;
|
||||
|
||||
status = reinit_after_fork(smbd_messaging_context(),
|
||||
smbd_event_context(), true);
|
||||
smbd_event_context(), procid_self(),
|
||||
true);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
if (NT_STATUS_EQUAL(status,
|
||||
NT_STATUS_TOO_MANY_OPENED_FILES)) {
|
||||
@ -806,6 +807,7 @@ extern void build_options(bool screen);
|
||||
};
|
||||
struct smbd_parent_context *parent = NULL;
|
||||
TALLOC_CTX *frame = talloc_stackframe(); /* Setup tos. */
|
||||
NTSTATUS status;
|
||||
|
||||
smbd_init_globals();
|
||||
|
||||
@ -998,8 +1000,10 @@ extern void build_options(bool screen);
|
||||
if (is_daemon)
|
||||
pidfile_create("smbd");
|
||||
|
||||
if (!NT_STATUS_IS_OK(reinit_after_fork(smbd_messaging_context(),
|
||||
smbd_event_context(), false))) {
|
||||
status = reinit_after_fork(smbd_messaging_context(),
|
||||
smbd_event_context(),
|
||||
procid_self(), false);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0,("reinit_after_fork() failed\n"));
|
||||
exit(1);
|
||||
}
|
||||
|
@ -1122,6 +1122,7 @@ int main(int argc, char **argv, char **envp)
|
||||
poptContext pc;
|
||||
int opt;
|
||||
TALLOC_CTX *frame = talloc_stackframe();
|
||||
NTSTATUS status;
|
||||
|
||||
/* glibc (?) likes to print "User defined signal 1" and exit if a
|
||||
SIGUSR[12] is received before a handler is installed */
|
||||
@ -1278,9 +1279,10 @@ int main(int argc, char **argv, char **envp)
|
||||
* winbindd-specific resources we must free yet. JRA.
|
||||
*/
|
||||
|
||||
if (!NT_STATUS_IS_OK(reinit_after_fork(winbind_messaging_context(),
|
||||
winbind_event_context(),
|
||||
false))) {
|
||||
status = reinit_after_fork(winbind_messaging_context(),
|
||||
winbind_event_context(),
|
||||
procid_self(), false);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0,("reinit_after_fork() failed\n"));
|
||||
exit(1);
|
||||
}
|
||||
|
@ -1106,10 +1106,12 @@ bool winbindd_reinit_after_fork(const char *logfilename)
|
||||
{
|
||||
struct winbindd_domain *domain;
|
||||
struct winbindd_child *cl;
|
||||
NTSTATUS status;
|
||||
|
||||
if (!NT_STATUS_IS_OK(reinit_after_fork(winbind_messaging_context(),
|
||||
winbind_event_context(),
|
||||
true))) {
|
||||
status = reinit_after_fork(winbind_messaging_context(),
|
||||
winbind_event_context(),
|
||||
procid_self(), true);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0,("reinit_after_fork() failed\n"));
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user