Please rebuild pcsc-lite with the attached patch. pcscd should now die immediatly when killed by init (at shutdown) or using kill(1) but should stop cleanly when using Ctrl-C.
Does this patch solve the probem for you? Bye -- Dr. Ludovic Rousseau
Index: src/pcscdaemon.c =================================================================== --- src/pcscdaemon.c (révision 5691) +++ src/pcscdaemon.c (copie de travail) @@ -459,8 +459,8 @@ int main(int argc, char **argv) * signal_trap() does just set a global variable used by the main loop */ (void)signal(SIGQUIT, signal_trap); - (void)signal(SIGTERM, signal_trap); - (void)signal(SIGINT, signal_trap); + (void)signal(SIGTERM, signal_trap); /* default kill signal & init round 1 */ + (void)signal(SIGINT, signal_trap); /* sent by Ctrl-C */ /* exits on SIGALARM to allow pcscd to suicide if not used */ (void)signal(SIGALRM, signal_trap); @@ -675,6 +675,14 @@ static void signal_trap(int sig) { Log2(PCSC_LOG_INFO, "Received signal: %d", sig); + /* do not wait if asked to terminate + * avoids waiting after the reader(s) in shutdown for example */ + if (SIGTERM == sig) + { + Log1(PCSC_LOG_INFO, "Direct suicide"); + at_exit(); + } + /* the signal handler is called several times for the same Ctrl-C */ if (AraKiri == FALSE) {