From owner-freebsd-questions@FreeBSD.ORG Wed Oct 26 11:28:04 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AA6B516A41F for ; Wed, 26 Oct 2005 11:28:04 +0000 (GMT) (envelope-from matrix@itlegion.ru) Received: from osiris.itlegion.ru (osiris.itlegion.ru [84.21.226.210]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4221443D58 for ; Wed, 26 Oct 2005 11:28:02 +0000 (GMT) (envelope-from matrix@itlegion.ru) Received: from Artem ([192.168.0.12]) by osiris.itlegion.ru (8.13.3/8.13.1) with SMTP id j9QBS0ws045076 for ; Wed, 26 Oct 2005 15:28:00 +0400 (MSD) (envelope-from matrix@itlegion.ru) X-AntiVirus: Checked by Dr.Web [version: 4.33, engine: 4.33.0.09273, virus records: 89786, updated: 26.09.2005] Message-ID: <00fc01c5da20$41801990$0c00a8c0@Artem> From: "Artem Kuchin" To: "FreeBSD questions" References: <20051026034133.47941.qmail@web36215.mail.mud.yahoo.com> <20051026103032.GN39882@cirb503493.alcatel.com.au> Date: Wed, 26 Oct 2005 15:27:28 +0400 Organization: IT Legion MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: How to terminate TCP connection? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Oct 2005 11:28:04 -0000 Hi! I am running several jails. Each jail runs many services includinh SMTP, POP,IMAP, HTTP. Somtimes i need to restart all jails. So, i /etc/rc.d/jail stop And then i wait until jls shows nothing. However, it usually takes very long or unacceptably long because FreebBSD does not delete jail until all connections to it are gone. So, i have no processes running in a jail, but netstat -n show several connections (usually SYN_FIN1, SYN_FIN2, LAST_ACK states) and they hang there for a very long time. Usually, i have to reboot the server to finaly get rid of all jails and connctions. But sometimes I need to restart only one jail and have the same problem and have to wait for 20-30 minutes until all connections die. Clients are ready to kill me at such moments. So, the question, Is there a way to kill off stuck tcp connection (or actually ANY connection which are shown by netstat) or maybe there is a way to force jail termination without waiting until all connection are gone. Artem