Add shutdown tracing for nwserv, nwbind and ncpserv

This commit is contained in:
Mario Fetka
2026-04-20 23:39:42 +02:00
parent 5a2fbb0a9d
commit eab9c16971
3 changed files with 60 additions and 9 deletions

View File

@@ -2067,8 +2067,10 @@ static void handle_ctrl()
case 0xffff : /* server down */
data_len = xread(&ipxd, &offs, (char*)&conn, sizeof(int));
if (sizeof(int) == data_len && conn == what)
if (sizeof(int) == data_len && conn == what) {
XDPRINTF((1, 0, "handle_ctrl: nwbind got CTRL 0xffff, conn=0x%x", conn));
sent_down_message();
}
break;
default : break;
} /* switch */
@@ -2081,6 +2083,7 @@ static void handle_ctrl()
static int got_sig=0;
static void sig_handler(int isig)
{
XDPRINTF((1, 0, "sig_handler: nwbind got signal=%d", isig));
got_sig=isig;
signal(isig, sig_handler);
}
@@ -2227,11 +2230,15 @@ int main(int argc, char *argv[])
}
if (got_sig == SIGHUP) {
/* here I update some Bindery stuff from nwserv.conf */
XDPRINTF((1, 0, "main: nwbind handling SIGHUP"));
reinit_nwbind();
got_sig = 0;
} else if (got_sig == SIGUSR2) {
XDPRINTF((1, 0, "main: nwbind handling SIGUSR2"));
handle_usr2(); /* mst:25-Apr-00 */
got_sig = 0;
} else if (got_sig == SIGQUIT) {
XDPRINTF((1, 0, "main: nwbind leaving main loop on SIGQUIT"));
}
}
@@ -2251,6 +2258,6 @@ int main(int argc, char *argv[])
internal_act=1;
nw_exit_dbm();
xfree(connections);
XDPRINTF((2,0, "LEAVE nwbind"));
XDPRINTF((1,0, "LEAVE nwbind"));
return(0);
}