mark.b...@thales-is.com writes:
> We have a program that ssh's to another system to run scp copying
> files back to the original system. If there are no files present on
> the remote system, the ssh occasionally hangs, and we don't know why!
>
> e.g. Program running on System A has C code:
>
> sprintf (cmd, "ssh -n B 'scp -p /srcdir/* A:/destdir'");
> status = system(cmd);
Any reason you're not using:
"scp 'B:/srcdir/*' /destdir"
?
> If /srcdir is empty, the ssh occasionally hangs, although running the
> ssh command manually does return with error:
> /srcdir/*: No such file or directory
>
> Any ideas?
Might be worth applying strace to the hung process to see if you can get
some idea what it's stuck on.
--
http://www.greenend.org.uk/rjk/