Welcome to the Builder Academy

Important Can't figure out SYSERR on sleep

More
20 Oct 2023 16:38 #10349 by Salty
Code:
[Oct 19 01:35:44 2023 :: No connections.  Going to sleep. Oct 19 01:35:54 2023 :: New connection.  Waking up. Oct 19 01:35:55 2023 :: Losing descriptor without char. Oct 19 01:35:55 2023 :: No connections.  Going to sleep. Oct 19 04:21:30 2023 :: New connection.  Waking up. Oct 19 04:21:55 2023 :: Losing descriptor without char. Oct 19 04:21:55 2023 :: No connections.  Going to sleep. Oct 19 05:04:24 2023 :: SYSERR: Received SIGHUP, SIGINT, or SIGTERM.  Shutting down... Using file descriptor for logging.

I've looked all over comm.c
The function static void signal_setup(void) is calling my_signal(SIGHUP, hupsig), my_signal(SIGINT, hupsig) and my_signal(SIGTERM, hupsig)

I'm on Ubuntu so I believe the my_signal() function is:
Code:
static sigfunc *my_signal(int signo, sigfunc *func) {   struct sigaction sact, oact;   sact.sa_handler = func;   sigemptyset(&sact.sa_mask);   sact.sa_flags = 0; #ifdef SA_INTERRUPT   sact.sa_flags |= SA_INTERRUPT;        /* SunOS */ #endif   if (sigaction(signo, &sact, &oact) < 0)     return (SIG_ERR);   return (oact.sa_handler); } #endif                          /* POSIX */

Any help would be appreciated.  I'm at a loss here.

Please Log in or Create an account to join the conversation.

More
20 Oct 2023 22:21 #10351 by thomas
Well, it seems there's not really happening anything at the time the mud stops. After all, you're in "sleep mode", waiting for new connections.

You could try to run your code through gdb, as specified here: www.tbamud.com/forum/4-development/6-debugging-tutorial-for-gdb

Or you could have a look on your system. Could it be that the mud process is killed by some watchdog daemon? The code you are showing and the my_signal(SIGHUP, hupsig) calls makes sure that the code in hupsig() gets called:
Code:
/* Dying anyway... */ static RETSIGTYPE hupsig(int sig) { log("SYSERR: Received SIGHUP, SIGINT, or SIGTERM. Shutting down..."); exit(1); /* perhaps something more elegant should substituted */ }
Basically, just logging and then shutting down.

So, it's something external sending the signal to shut down and your mud is complying. The message is just there to notify you that the mud was killed in an orderly fashion.

Please Log in or Create an account to join the conversation.

Time to create page: 0.288 seconds