From owner-freebsd-bugs@FreeBSD.ORG Wed May 20 11:00:07 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56ADA106566B for ; Wed, 20 May 2009 11:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 431A88FC08 for ; Wed, 20 May 2009 11:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KB06Q1047853 for ; Wed, 20 May 2009 11:00:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n4KB060v047852; Wed, 20 May 2009 11:00:06 GMT (envelope-from gnats) Date: Wed, 20 May 2009 11:00:06 GMT Message-Id: <200905201100.n4KB060v047852@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Dimitry Andric Cc: Subject: Re: bin/134694: gives false-positive when unable to obtain socket [WAS: sshd(8) - alert user when fails to execute from rc.d] X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Dimitry Andric List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 11:00:07 -0000 The following reply was made to PR bin/134694; it has been noted by GNATS. From: Dimitry Andric To: rea-fbsd@codelabs.ru Cc: Glen Barber , hackers@freebsd.org, bug-followup@freebsd.org Subject: Re: bin/134694: gives false-positive when unable to obtain socket [WAS: sshd(8) - alert user when fails to execute from rc.d] Date: Wed, 20 May 2009 12:54:56 +0200 On 2009-05-20 12:19, Eygene Ryabinkin wrote: > You seem to mix two things: binding to the port and the output from rc.d > 'status' command. Binding to the port is done by SSH by the bind(2) > system call and if something is already listening on the given address, > the socket won't be bound, so SSH daemon terminates. I think what might be confusing, is the fact that sshd dies due to bind() failing, and it should; but you will only see this in the syslog, NOT on the command line. E.g. the /etc/rc.d/sshd script will NOT give an error, because the /usr/bin/sshd it calls will fork, and as soon as the fork is okay, the original instance with exit with 0. The forked instance is what will die on bind(), so you will not see any failures from it.