From owner-freebsd-hackers@FreeBSD.ORG Wed May 20 10:54:56 2009 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F409C1065675; Wed, 20 May 2009 10:54:55 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id B3B058FC18; Wed, 20 May 2009 10:54:55 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from [IPv6:2001:7b8:3a7:0:8d33:c8ee:aff8:342] (unknown [IPv6:2001:7b8:3a7:0:8d33:c8ee:aff8:342]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id CFD405C42; Wed, 20 May 2009 12:54:54 +0200 (CEST) Message-ID: <4A13E180.1040606@andric.com> Date: Wed, 20 May 2009 12:54:56 +0200 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1b5pre) Gecko/20090515 Shredder/3.0b3pre MIME-Version: 1.0 To: rea-fbsd@codelabs.ru References: <4ad871310905181949s2874795eoa5ddf425746310bf@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: hackers@freebsd.org, Glen Barber , 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] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 10:54:56 -0000 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.