Package: sredird
Version: 2.2.1-1.1

To begin, I'm using sredird in a RedHat 8 system.
uname -a  -->  Linux bfscs320.lsikc3.net 2.4.20-30.8.legacy.2 #1 Thu Jan 6 
14:15:57 EST 2005 i486 i486 i386 GNU/Linux
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)


I use xinetd to start sredird, the config file to start sredird is below.
I use a telnet client to connect to sredird (telnet abc.com 6001)
If I send a SIGTERM to sredird, it does not exit. The files are all closed and
the lock released, but both sredird and the telnet client remain running.
A SIGKILL to sredird will end sredird and the telnet client exits. (That's
what I expect to happen with a SIGKILL)

I believe the problem is in the function SignalFunction. It calls ExitFunction, 
which
does all the cleanup, but then returns to SignalFunction, which then returns to 
the
interrupted code. 

I replaced the call to ExitFunction with a call to exit(0), and sredird now 
exits if it gets a
SIGTERM. 

I did the same to BreakFunction, but I have not tested that change yet.


I hope this helps.

================================================
/* Function called on many signals */
void SignalFunction(int unused)
  {
    /* Just to avoid compilation warnings */
    /* There's no performance penalty in doing this 
    because this function is almost never called */
    unused = unused;
    
    /* Same as the exit function */
    /*ExitFunction();   replace with a call to exit */
    exit (0);
  }




=============== sredird xinetd startup file ==================
service scsport6001
{
     type        = unlisted
     socket_type = stream
     wait        = no
     user        = root
     server      = /usr/local/sbin/sredird
     server_args = 5 /dev/ttyB1 /var/lock/LCK..ttyB1 5
     port        = 6001
     disable     = no
}

-- 
Bill Feero
Logical Solutions, Inc.

Attachment: pgpt55GDVilTN.pgp
Description: PGP signature

Reply via email to