On 2024-05-30 00:19:30 +0700, Max Nikulin wrote: > On 29/05/2024 07:44, Vincent Lefevre wrote: > > But I don't understand why there was a timeout. Does this mean that > > mutt didn't react to SIGTERM? Any reason? > > Have you tried to send SIGTERM to mutt?
I didn't. AFAIK, systemd sends a SIGTERM to all the processes of the session: that's the May 29 01:55:05 qaa systemd[1]: Stopping session-2.scope - Session 2 of User vinc17... but this timed out, apparently due to the mutt process, which was still running, so that systemd sent a SIGKILL (which succeeded). May 29 01:55:26 qaa systemd[1]: session-2.scope: Stopping timed out. Killing. May 29 01:55:26 qaa systemd[1]: session-2.scope: Killing process 2990 (mutt) with signal SIGKILL. > If it ignores this signal or the reaction is some prompt then you > need to find another way to stop mutt and to configure systemd user > session to do it on logout (shutdown). A SIGTERM normally kills mutt. In signal.c, signals are blocked "while doing critical ops", namely for compressing/decompressing (which I don't use) and when locking a mailbox (but I don't see why this would have happened). Otherwise the signal handler just does that: static void exit_handler (int sig) { curs_set (1); endwin (); /* just to be safe */ exit_print_string (Caught_Signal_L10N ? Caught_Signal_L10N : "Caught signal "); #if SYS_SIGLIST_DECLARED exit_print_string (sys_siglist[sig]); #else #if (__sun__ && __svr4__) exit_print_string (_sys_siglist[sig]); #else #if (__alpha && __osf__) exit_print_string (__sys_siglist[sig]); #else exit_print_int (sig); #endif #endif #endif exit_print_string (Exiting_L10N ? Exiting_L10N : "... Exiting.\n"); exit (0); } -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)