From owner-freebsd-ports@FreeBSD.ORG Tue Nov 4 14:00:58 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF2A67F1 for ; Tue, 4 Nov 2014 14:00:58 +0000 (UTC) Received: from gw.zefyris.com (zefyris4.pck.nerim.net [62.212.120.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EBBD81E for ; Tue, 4 Nov 2014 14:00:57 +0000 (UTC) Received: from sekishi.zefyris.com (sekishi.zefyris.com [IPv6:2001:7a8:3c67:2::12]) by gw.zefyris.com (8.14.5/8.14.5) with ESMTP id sA496rim163673; Tue, 4 Nov 2014 10:06:54 +0100 (CET) Date: Tue, 4 Nov 2014 10:06:53 +0100 From: Francois Tigeot To: Denny Lin Subject: Re: SSH hangs while restarting services Message-ID: <20141104090652.GA72200@sekishi.zefyris.com> References: <20141104004803.GE3153@mail.hs.ntnu.edu.tw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141104004803.GE3153@mail.hs.ntnu.edu.tw> User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gw.zefyris.com [IPv6:2001:7a8:3c67:2::254]); Tue, 04 Nov 2014 10:07:24 +0100 (CET) Cc: freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 14:00:58 -0000 Hi, On Tue, Nov 04, 2014 at 08:48:03AM +0800, Denny Lin wrote: > > Recently I've been trying to restart services remotely using SSH using a > command instead of entering the shell: > ssh host "sudo service postgresql restart" > > PostgreSQL is able to restart successfully, but SSH just hangs there > instead of exiting. I've noticed that this seems to affect any command > which spawns a child process which doesn't exit. Can you check if it's really ssh which hangs or sudo ? I have just stumbled upon a sudo bug myself: the child process launched by sudo-1.8.11 hangs in the manner you just described. The same command launched by sudo-1.8.10 works fine. Running sudo /bin/sh and quitting the new shell is enough to verify if everything's fine or not. -- Francois Tigeot