From owner-freebsd-bugs Mon Oct 7 11:10:13 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5995137B40B for ; Mon, 7 Oct 2002 11:10:09 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9DE7943E77 for ; Mon, 7 Oct 2002 11:10:08 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g97IA8Co093534 for ; Mon, 7 Oct 2002 11:10:08 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g97IA825093533; Mon, 7 Oct 2002 11:10:08 -0700 (PDT) Date: Mon, 7 Oct 2002 11:10:08 -0700 (PDT) Message-Id: <200210071810.g97IA825093533@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Arne Woerner Subject: Re: kern/43739: cannot open file without obvious reason Reply-To: Arne Woerner Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/43739; it has been noted by GNATS. From: Arne Woerner To: roam@ringlet.net Cc: bug-followup@FreeBSD.org, fanf@FreeBSD.org Subject: Re: kern/43739: cannot open file without obvious reason Date: Mon, 7 Oct 2002 17:42:18 GMT > From roam@ringlet.net Mon Oct 7 17:30:16 2002 > Date: Mon, 7 Oct 2002 20:21:07 +0300 > From: Peter Pentchev > To: Arne Woerner > Cc: fanf@FreeBSD.org, bug-followup@FreeBSD.org > Subject: Re: kern/43739: cannot open file without obvious reason > References: <200210071707.g97H7g2F001469@gargano.local.mediabase-gmbh.de> > Mime-Version: 1.0 > Content-Type: text/plain; charset=windows-1251 > Content-Disposition: inline > In-Reply-To: <200210071707.g97H7g2F001469@gargano.local.mediabase-gmbh.de> > User-Agent: Mutt/1.5.1i > X-Virus-Scanned: by Nik's Monitoring Daemon (AMaViS perl-11d ) > X-UIDL: A8 > On Mon, Oct 07, 2002 at 05:07:42PM +0000, Arne Woerner wrote: > > Wrong! Wrong! Wrong! :) > > > > Due to the "lockf" it is impossible that there are more than > > two ICanDo.sh processes... > > Uhm.. excuse me? What is to prevent the SSH session starting up > a billion of ICanDo.sh processes? > IT IS THE "LOCKF"! While the lockf blocks the session will not terminate. And a new session can only be started as soon as the old session terminates. See: ( repeat 1000000000 ssh cyclops ./ICanDo.sh ) < /dev/null & I wonder why you both are reading my emails if you do not want to understand them. I do not spend my time writing bug reports just for your amusement or to allow you to insult me. > Each SSH session operates in one of the following ways: > > 1. Log in - this eats a file descriptor for the socket. > > 2. Start a shell running ICanDo.sh - this eats a couple of file > descriptors for the shell's /bin/sh executable and for the ICanDo.sh > file that the shell needs to read to execute. > > 3. Start executing ICanDo.sh - at this point, there are at least two > file descriptors consumed by this session on the target host. > > 4. Start lockf(1) - this needs an additional file descriptor for reading > in the lockf(1)'s executable file. > > 5. Open the 'gaga' lockfile. > > 6. Try to flock(2) the 'gaga' lockfile *after having opened it* - > please take a look at the lockf(1), flock(2) and lockf(3) manual > pages; the lockfile needs to be opened in order to be locked. > > At this step, if the file may not be locked, there are still at least > two, maybe up to four file descriptors in use, two of which may not > be reclaimed under any circumstances. So, each of your billion SSH > sessions eats up at least two file descriptors. > No! > I think somebody should spend a little more time reading the relevant > utilities' manual pages :) > Laa-Laa is cuter than you! -Arne "I want to understand..." (Fox Mulder?) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message