Subject: Stopped (tty output)
To: None <current-users@NetBSD.ORG>
From: Alan Barrett <>
List: current-users
Date: 06/11/1998 15:37:12
NetBSD/i386 -current as of a week or two ago.
rsync-1.6.9 from pkgsrc/net/rsync.
ssh-1.2.23 from pkgsrc/security/ssh.

When I run a command like

	rsync --rsh ssh -a user@host:/sourcedir /destdir

from the shell, it works fine.  ssh is set up to prompt for a password,
which it does, and rsync proceeds to synchronise the local and remote

But if I run exactly the same command from make, it fails when ssh
gets to the password prompt.  I see this:

	bash> make
	rsync --rsh ssh -a user@host:/sourcedir /destdir
	user@host's password: Stopped (tty output)
	Received signal 30.
	*** Error code 150


I have tried putting the rsync command in a file, and running the file
with "sh filename".  Almost the same problem as when running the command
from make; now I see:

	bash> cat t
	rsync --rsh ssh -a user@host:/sourcedir /destdir
	bash> /bin/sh ./t
	user@host's password: Stopped (tty output)
	You have stopped jobs.

	Received signal 30.

I tried using "rsync --rsh 'my-script-that-does-stuff'", and had my script
do "stty -a </dev/tty" with output to a file in /tmp, then echo a prompt
and read something.  The stty output from inside the script is identical to
that from the shell prompt, so if rsync is doing weird things to the tty
I can't see what.  Strangely, my script gets "Stopped (tty input)"
instead of "Stopped (tty output)".  This is what I see:

	bash> cat tt
	rsync --rsh ./myscript -a user@host:/sourcedir /destdir
	bash> cat myscript
	stty -a </dev/tty >/tmp/mylog
	echo prompt
	read foo
	exit 1
	bash> /bin/sh ./tt
	Stopped (tty input)
	You have stopped jobs.
	bash> stty -a </dev/tty | diff - /tmp/mylog
	[no differences]

Where should I look to fix this?  (I have tried using /bin/sh instead of
bash: same problem either way.) 

--apb (Alan Barrett)