Bug #3091

add -n to zlogin so its more compatible with rsh command line

Added by Darren Reed over 8 years ago. Updated about 7 years ago.

Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


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.


zlogin.diff (3.38 KB) zlogin.diff Darren Reed, 2012-08-18 02:49 PM

Updated by Gary Mills over 7 years ago

  • Status changed from New to Feedback
The reason for the `-n' option of `rsh' that's cited in the man page has to do with job control and any command on the remote host, even if it doesn't read from standard input. Here's an example:

$ rsh localhost date &
[1] 15945
$ jobs
[1] + Stopped (SIGTTIN) rsh localhost date &
$ kill %1
Wednesday, January 15, 2014 08:16:46 PM CST
[1] + 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:
  1. zlogin tzone read foo & [1] 20811
  2. [1] + Stopped (SIGTTIN) zlogin tzone read foo &
  3. kill 1 [1] + Terminated zlogin tzone read foo x%x
    In this case, redirecting standard input to /dev/null does avoid the job control block.

Updated by Gary Mills over 7 years ago

Here's the second example again:

/# zlogin tzone read foo &
[1] 20811
[1] + Stopped (SIGTTIN) zlogin tzone read foo &
/# kill %1
[1] + Terminated zlogin tzone read foo &


Updated by Gary Mills about 7 years ago

  • Assignee set to Gary Mills
  • % Done changed from 0 to 80

Updated by Rich Lowe about 7 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 80 to 100
  • Tags deleted (needs-triage)

Resolved in 279721b

Also available in: Atom PDF