Date: Wed, 5 Nov 2014 17:22:14 +0800 From: Denny Lin <dennylin93@hs.ntnu.edu.tw> To: freebsd-ports@freebsd.org Subject: Re: SSH hangs while restarting services Message-ID: <20141105092214.GF3153@mail.hs.ntnu.edu.tw> In-Reply-To: <20141104004803.GE3153@mail.hs.ntnu.edu.tw> References: <20141104004803.GE3153@mail.hs.ntnu.edu.tw>
next in thread | previous in thread | raw e-mail | index | archive | help
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. > > Is there any way to get SSH terminate? Thanks. Sorry, I accidentally deleted the replies in my mailbox, so I'll respond here. I've tried running sudo /bin/sh and exiting immediately. There isn't any hang, so it shouldn't be a sudo bug. I see the same hang over SSH if I fork a process without sudo. Adding -f to ssh like Kevin suggested solved the problem. Thanks! -- Denny Lin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141105092214.GF3153>