Print this page
    
OS-4136 would like SIGUSR to zlogin to switch in and out of '-N' modes
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
OS-4109 'zlogin -I' should close /dev/zfd/0 when it exits
OS-3524 in order to support interaction with docker containers, need to be able to connect to stdio for init from GZ
OS-3525 in order to support 'docker logs' need to be able to get stdio from zone to log file
OS-3529 would like zlogin -i
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/man/man1/zlogin.1
          +++ new/usr/src/man/man1/zlogin.1
   1    1  '\" te
   2    2  .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved
   3    3  .\" The contents of this file are subject to the terms of the Common
   4    4  .\" Development and Distribution License (the "License").  You may not use this
   5    5  .\" file except in compliance with the License.
  
    | 
      ↓ open down ↓ | 
    5 lines elided | 
    
      ↑ open up ↑ | 
  
   6    6  .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or
   7    7  .\" http://www.opensolaris.org/os/licensing.  See the License for the specific
   8    8  .\" language governing permissions and limitations under the License.
   9    9  .\" When distributing Covered Code, include this CDDL HEADER in each file and
  10   10  .\" include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable,
  11   11  .\" add the following below this CDDL HEADER, with the fields enclosed by
  12   12  .\" brackets "[]" replaced with your own identifying information:
  13   13  .\" Portions Copyright [yyyy] [name of copyright owner]
  14   14  .\" Copyright 2013 DEY Storage Systems, Inc.
  15   15  .\" Copyright (c) 2014 Gary Mills
       16 +.\" Copyright (c) 2015, Joyent, Inc. All Rights Reserved
  16   17  .\" Copyright 2015 Nexenta Systems, Inc. All rights reserved.
  17      -.TH ZLOGIN 1 "Mar 17, 2015"
       18 +.TH ZLOGIN 1 "Mar 30, 2015"
  18   19  .SH NAME
  19   20  zlogin \- enter a zone
  20   21  .SH SYNOPSIS
  21   22  .LP
  22   23  .nf
  23      -\fBzlogin\fR [\fB-dCEQ\fR] [\fB-e\fR \fIc\fR] [\fB-l\fR \fIusername\fR] \fIzonename\fR
       24 +\fBzlogin\fR [\fB-dCEINQ\fR] [\fB-e\fR \fIc\fR] [\fB-l\fR \fIusername\fR] \fIzonename\fR
  24   25  .fi
  25   26  
  26   27  .LP
  27   28  .nf
  28      -\fBzlogin\fR [\fB-nEQS\fR] [\fB-e\fR \fIc\fR] [\fB-l\fR \fIusername\fR] \fIzonename\fR \fIutility\fR
       29 +\fBzlogin\fR [\fB-inEQS\fR] [\fB-e\fR \fIc\fR] [\fB-l\fR \fIusername\fR] \fIzonename\fR \fIutility\fR
  29   30       [\fIargument\fR]...
  30   31  .fi
  31   32  
  32   33  .SH DESCRIPTION
  33      -.sp
  34   34  .LP
  35   35  The \fBzlogin\fR utility is used by the administrator to enter an operating
  36   36  system zone. Only a superuser operating in the global system zone can use this
  37   37  utility.
  38   38  .sp
  39   39  .LP
  40      -\fBzlogin\fR operates in one of three modes:
       40 +\fBzlogin\fR operates in one of four modes:
  41   41  .sp
  42   42  .ne 2
  43   43  .na
  44   44  \fBInteractive Mode\fR
  45   45  .ad
  46   46  .RS 24n
  47      -If no utility argument is given and the stdin file descriptor for the
  48      -\fBzlogin\fR process is a tty device, \fBzlogin\fR operates in \fBinteractive
  49      -mode\fR. In this mode, \fBzlogin\fR creates a new pseudo terminal for use
  50      -within the login session. Programs requiring a tty device, for example,
  51      -\fBvi\fR(1), work properly in this mode. In this mode, \fBzlogin\fR invokes
  52      -\fBlogin\fR(1) to provide a suitable login session.
       47 +If no utility argument is given or if the \fB-i\fR option is specified, and the
       48 +stdin file descriptor for the \fBzlogin\fR process is a tty device, \fBzlogin\fR
       49 +operates in \fBinteractive mode\fR. In this mode, \fBzlogin\fR creates a new
       50 +pseudo terminal for use within the login session. Programs requiring a tty
       51 +device, for example, \fBvi\fR(1), work properly in this mode. In this mode,
       52 +\fBzlogin\fR invokes \fBlogin\fR(1) to provide a suitable login session.
  53   53  .RE
  54   54  
  55   55  .sp
  56   56  .ne 2
  57   57  .na
  58   58  \fBNon-Interactive Mode\fR
  59   59  .ad
  60   60  .RS 24n
  61      -If a utility is specified, \fBzlogin\fR operates in \fBnon-interactive mode\fR.
  62      -This mode can be useful for script authors since stdin, stdout, and stderr are
  63      -preserved and the exit status of \fIutility\fR is returned upon termination. In
  64      -this mode, \fBzlogin\fR invokes \fBsu\fR(1M) in order to set up the user's
  65      -environment and to provide a login environment.
       61 +If a utility is specified and the \fB-i\fR option is not specified, \fBzlogin\fR
       62 +operates in \fBnon-interactive mode\fR.  This mode can be useful for script
       63 +authors since stdin, stdout, and stderr are preserved and the exit status of
       64 +\fIutility\fR is returned upon termination. In this mode, \fBzlogin\fR invokes
       65 +\fBsu\fR(1M) in order to set up the user's environment and to provide a login
       66 +environment.
  66   67  .sp
  67   68  The specified command is passed as a string and interpreted by a shell running
  68   69  in the non-global zone. See \fBrsh\fR(1).
  69   70  .RE
  70   71  
  71   72  .sp
  72   73  .ne 2
  73   74  .na
  74   75  \fBConsole Mode\fR
  75   76  .ad
  76   77  .RS 24n
  77   78  If the \fB-C\fR option is specified, the user is connected to the zone console
  78   79  device and \fBzlogin\fR operates in \fBconsole mode\fR. The zone console is
  79   80  available once the zone is in the installed  state. Connections to the console
  80   81  are persistent across reboot of the zone.
  81   82  .RE
  82   83  
  83      -.SH OPTIONS
  84   84  .sp
       85 +.ne 2
       86 +.na
       87 +\fBStandalone-processs Interactive Mode\fR
       88 +.ad
       89 +.RS 24n
       90 +If the \fB-I\fR option is specified the user is connected to the zone's stdin,
       91 +stdout and stderr \fBzfd(7D)\fR devices.
       92 +.RE
       93 +
       94 +.SH OPTIONS
  85   95  .LP
  86   96  The following options are supported:
  87   97  .sp
  88   98  .ne 2
  89   99  .na
  90  100  \fB\fB-C\fR\fR
  91  101  .ad
  92  102  .RS 15n
  93  103  Connects to the zone console.
  94  104  .RE
  95  105  
  96  106  .sp
  97  107  .ne 2
  98  108  .na
  99  109  \fB\fB-d\fR\fR
 100  110  .ad
 101  111  .RS 15n
 102  112  Disconnect from the console when the zone halts. This option may only be used
 103  113  if the \fB-C\fR option is specified.
 104  114  .RE
 105  115  
 106  116  .sp
 107  117  .ne 2
 108  118  .na
 109  119  \fB\fB-e\fR \fIc\fR\fR
 110  120  .ad
 111  121  .RS 15n
 112  122  Specifies a different escape character, \fIc\fR, for the key sequence used to
 113  123  access extended functions and to disconnect from the login. The default escape
 114  124  character is the tilde (\fB~\fR).
 115  125  .RE
 116  126  
 117  127  .sp
 118  128  .ne 2
 119  129  .na
  
    | 
      ↓ open down ↓ | 
    25 lines elided | 
    
      ↑ open up ↑ | 
  
 120  130  \fB\fB-E\fR\fR
 121  131  .ad
 122  132  .RS 15n
 123  133  Disables the ability to access extended functions or to disconnect from the
 124  134  login by using the escape sequence character.
 125  135  .RE
 126  136  
 127  137  .sp
 128  138  .ne 2
 129  139  .na
      140 +\fB\fB-i\fR\fR
      141 +.ad
      142 +.RS 15n
      143 +Forces interactive mode when a utility argument is specified.
      144 +.RE
      145 +
      146 +.sp
      147 +.ne 2
      148 +.na
      149 +\fB\fB-I\fR\fR
      150 +.ad
      151 +.RS 15n
      152 +Connects to the zone's \fBzfd(7D)\fR devices.
      153 +.RE
      154 +
      155 +.sp
      156 +.sp
      157 +.ne 2
      158 +.na
 130  159  \fB\fB-l\fR \fIusername\fR\fR
 131  160  .ad
 132  161  .RS 15n
 133  162  Specifies a different \fIusername\fR for the zone login. If you do not use this
 134  163  option, the zone username used is "root". This option is invalid if the
 135  164  \fB-C\fR option is specified.
 136  165  .RE
 137  166  
 138  167  .sp
 139  168  .ne 2
 140  169  .na
 141  170  \fB-n\fR
  
    | 
      ↓ open down ↓ | 
    2 lines elided | 
    
      ↑ open up ↑ | 
  
 142  171  .ad
 143  172  .RS 15n
 144  173  Redirect the input of \fBzlogin\fR to \fB/dev/null\fR.
 145  174  This option is useful when the command running in the local zone
 146  175  and the shell which invokes \fBzlogin\fR both read from standard input.
 147  176  .RE
 148  177  
 149  178  .sp
 150  179  .ne 2
 151  180  .na
      181 +\fB-N\fR
      182 +.ad
      183 +.RS 15n
      184 +Nohup. This may only be used with the -I option to avoid sending EOF to the zfd
      185 +device when zlogin's stdin receives EOF. It can also be toggled by sending
      186 +\fBSIGUSR1\fR to an attached zlogin process.
      187 +.RE
      188 +
      189 +.sp
      190 +.ne 2
      191 +.na
 152  192  \fB-Q\fR
 153  193  .ad
 154  194  .RS 15n
 155  195  Specifies quiet mode operation.  In quiet mode, extra messages indicating the
 156  196  the function of \fBzlogin\fR will not be displayed, giving the possibility
 157  197  to present the appearance that the command is running locally rather than
 158  198  in another zone.
 159  199  .RE
 160  200  
 161  201  .sp
 162  202  .ne 2
 163  203  .na
 164  204  \fB\fB-S\fR\fR
  
    | 
      ↓ open down ↓ | 
    3 lines elided | 
    
      ↑ open up ↑ | 
  
 165  205  .ad
 166  206  .RS 15n
 167  207  "Safe" login mode. \fBzlogin\fR does minimal processing and does not invoke
 168  208  \fBlogin\fR(1) or \fBsu\fR(1M). The \fB-S\fR option can not be used if a
 169  209  username is specified through the \fB-l\fR option, and cannot be used with
 170  210  console logins. This mode should only be used to recover a damaged zone when
 171  211  other forms of login have become impossible.
 172  212  .RE
 173  213  
 174  214  .SS "Escape Sequences"
 175      -.sp
 176  215  .LP
 177  216  Lines that you type that start with the tilde character (\fB~\fR) are "escape
 178  217  sequences". The escape character can be changed using the \fB-e\fR option.
 179  218  .sp
 180  219  .ne 2
 181  220  .na
 182  221  \fB\fB~.\fR\fR
 183  222  .ad
 184  223  .RS 6n
 185  224  Disconnects from the zone. This is not the same as a logout, because the local
 186  225  host breaks the connection with no warning to the zone's end.
 187  226  .RE
 188  227  
 189  228  .SH SECURITY
 190      -.sp
 191  229  .LP
 192  230  Once a process has been placed in a zone other than the global zone, the
 193  231  process cannot change zone again, nor can any of its children.
 194  232  .SH OPERANDS
 195      -.sp
 196  233  .LP
 197  234  The following operands are supported:
 198  235  .sp
 199  236  .ne 2
 200  237  .na
 201  238  \fB\fIzonename\fR\fR
 202  239  .ad
 203  240  .RS 15n
 204  241  The name of the zone to be entered.
 205  242  .RE
 206  243  
 207  244  .sp
 208  245  .ne 2
 209  246  .na
 210  247  \fB\fIutility\fR\fR
 211  248  .ad
 212  249  .RS 15n
 213  250  The utility to be run in the specified zone.
 214  251  .RE
 215  252  
  
    | 
      ↓ open down ↓ | 
    10 lines elided | 
    
      ↑ open up ↑ | 
  
 216  253  .sp
 217  254  .ne 2
 218  255  .na
 219  256  \fB\fIargument...\fR\fR
 220  257  .ad
 221  258  .RS 15n
 222  259  Arguments passed to the utility.
 223  260  .RE
 224  261  
 225  262  .SH EXIT STATUS
 226      -.sp
 227  263  .LP
 228  264  In interactive and non-interactive modes, the \fBzlogin\fR utility exits when
 229  265  the command or shell in the non-global zone exits. In non-interactive mode, the
 230  266  exit status of the remote program is returned as the exit status of
 231  267  \fBzlogin\fR. In interactive mode and console login mode, the exit status is
 232  268  not returned. \fBzlogin\fR returns a \fB0\fR exit status as long as no
 233  269  connection-related error occurred.
 234  270  .sp
 235  271  .LP
 236  272  In all modes, in the event that a connection to the zone cannot be established,
 237  273  the connection fails unexpectedly, or the user is lacking sufficient privilege
 238  274  to perform the requested operation, \fBzlogin\fR exits with status \fB1\fR.
 239  275  .sp
 240  276  .LP
 241  277  To summarize, the following exit values are returned:
 242  278  .sp
 243  279  .ne 2
 244  280  .na
 245  281  \fB\fB0\fR\fR
 246  282  .ad
 247  283  .RS 7n
 248  284  Successful entry.
 249  285  .RE
 250  286  
 251  287  .sp
 252  288  .ne 2
 253  289  .na
 254  290  \fB\fB1\fR\fR
 255  291  .ad
 256  292  .RS 7n
 257  293  Permission denied, or failure to enter the zone.
 258  294  .RE
 259  295  
 260  296  .sp
  
    | 
      ↓ open down ↓ | 
    24 lines elided | 
    
      ↑ open up ↑ | 
  
 261  297  .ne 2
 262  298  .na
 263  299  \fBAny\fR
 264  300  .ad
 265  301  .RS 7n
 266  302  Return code from utility, or from \fBsu\fR(1M) if operating in non-interactive
 267  303  mode.
 268  304  .RE
 269  305  
 270  306  .SH ATTRIBUTES
 271      -.sp
 272  307  .LP
 273  308  See \fBattributes\fR(5) for descriptions of the following attributes:
 274  309  .sp
 275  310  
 276  311  .sp
 277  312  .TS
 278  313  box;
 279  314  c | c
 280  315  l | l .
 281  316  ATTRIBUTE TYPE  ATTRIBUTE VALUE
 282  317  _
 283  318  Interface Stability     Evolving
 284  319  .TE
 285  320  
 286  321  .SH SEE ALSO
 287      -.sp
 288  322  .LP
 289  323  \fBlogin\fR(1), \fBrsh\fR(1), \fBvi\fR(1), \fBsu\fR(1M), \fBzoneadm\fR(1M),
 290  324  \fBzonecfg\fR(1M), \fBattributes\fR(5), \fBzones\fR(5)
 291  325  .SH NOTES
 292      -.sp
 293  326  .LP
 294  327  \fBzlogin\fR fails if its open files or any portion of its address space
 295  328  corresponds to an NFS file. This includes the executable itself or the shared
 296  329  libraries.
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX