add -n to zlogin so its more compatible with rsh command line
In some circumstances, it is easy to replace the execution of rsh with zlogin quite easily, e.g.
rsh remotemachine uname -a
zlogin zonename uname -a
rsh -l root remotemachien ps
zlogin -l root remotemachine ps
It would be useful if this could be further extended to include the -n command line option for rsh. Whilst I have not yet run across any problems with zlogin running in the background from a shell, it stands to reason that it is possible for the same reasons that they happen with rsh and -n is required.
The attached patch is a first pass at this.
Updated by Gary Mills over 8 years ago
- Status changed from New to Feedback
$ rsh localhost date &
 + Stopped (SIGTTIN) rsh localhost date &
$ kill %1
Wednesday, January 15, 2014 08:16:46 PM CST
 + Done rsh localhost date &
This doesn't happen with zlogin. However, if the process in the zone actually does read from standard input, job control on the host does come into play, as in this example:
- zlogin tzone read foo &  20811
-  + Stopped (SIGTTIN) zlogin tzone read foo &
- kill 1  + Terminated zlogin tzone read foo x%x
In this case, redirecting standard input to /dev/null does avoid the job control block.