Why openssh newer than 2.9.9 doesn't send SIGTERM and SIGHUP to child process?

Petr Ostadal postadal at suse.cz
Fri Oct 11 20:44:46 EST 2002


Hi,

I search in archive list if there any reason why is removed in openssh
newer than 2.9.9 from function
'void session_close_by_channel(int id, void *arg)' sending of SIGTEMR and
SIGHUP signals to child as was in 2.9.9 version?  See follow sniped code
from 2.9.9 sources:

---- openssh-2.9.9/session.c ----------------------------------------
void
session_close_by_channel(int id, void *arg)
	...
        debug("session_close_by_channel: channel %d kill %d", id, s->pid);
        if (s->pid == 0) {
                /* close session immediately */
                session_close(s);
        } else {
                /* notify child, delay session cleanup */
                if (kill(s->pid, (s->ttyfd == -1) ? SIGTERM : SIGHUP) < 0)
		^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        error("session_close_by_channel: kill %d: %s",
                            s->pid, strerror(errno));
        }
    	...

----------------------------------------------------------------------------

This change in new version cause that some process (which doesn't need
terminal) hanged after termination ssh by e.g. SIGINT, becouse hanged
process doesn't receive any signal from ssh process.

basilisk:~> ssh basilisk 'sleep 1000'
23022: Killed by signal 2.
basilisk:~> ps -ef |grep sleep
postadal 23026     1  1 12:30 ?        00:00:00 sleep 100

The problem above can resolve Force pseudo-tty allocation (option -t), but
it is not  ideal solution.

Please, could anyone tell me why the new openssh doesn't send SIGHUP to
child process if ssh was terminated ?

	Thnx in advance

		Petr

--
Best Regards / S pozdravem,

Petr Ostadal
developer
---------------------------------------------------------------------
SuSE CR, s.r.o. 			e-mail: postadal at suse.cz
Drahobejlova 27 			tel:	+420 2 9654 2382
190 00 Praha 9 				fax:	+420 2 9654 2374
Czech Republic 				http://www.suse.cz




More information about the openssh-unix-dev mailing list