sshd and SIGKILL

Jani Jaakkola jjaakkol at cs.Helsinki.FI
Fri Sep 6 04:08:55 EST 2002


On Thu, 5 Sep 2002 Roumen.Petrov at skalasoft.com wrote:

> On command:
> #kill -9 `cat /var/run/sshd.pid`
> sshd leave pid file !
> 
> sshd.c code:
> ===============
> ....
> 		/*
> 		 * Arrange to restart on SIGHUP.  The handler needs
> 		 * listen_sock.
> 		 */
> 		signal(SIGHUP, sighup_handler);
> 
> 		signal(SIGTERM, sigterm_handler);
> 		signal(SIGQUIT, sigterm_handler);
> ....
> ===============
> 
> Missing line is :
> 		signal(SIGKILL, sigterm_handler);

SIGKILL can not be caught. SIGKILL will always kill the process 
immediately. You should not kill sshd with SIGKILL, if you want it to do 
any cleanup.

'man signal' tells you this too.

- Jani




More information about the openssh-unix-dev mailing list