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
_______________________________________________
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"

Reply via email to