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>
        
*** 11,70 ****
  .\" add the following below this CDDL HEADER, with the fields enclosed by
  .\" brackets "[]" replaced with your own identifying information:
  .\" Portions Copyright [yyyy] [name of copyright owner]
  .\" Copyright 2013 DEY Storage Systems, Inc.
  .\" Copyright (c) 2014 Gary Mills
  .\" Copyright 2015 Nexenta Systems, Inc. All rights reserved.
! .TH ZLOGIN 1 "Mar 17, 2015"
  .SH NAME
  zlogin \- enter a zone
  .SH SYNOPSIS
  .LP
  .nf
! \fBzlogin\fR [\fB-dCEQ\fR] [\fB-e\fR \fIc\fR] [\fB-l\fR \fIusername\fR] \fIzonename\fR
  .fi
  
  .LP
  .nf
! \fBzlogin\fR [\fB-nEQS\fR] [\fB-e\fR \fIc\fR] [\fB-l\fR \fIusername\fR] \fIzonename\fR \fIutility\fR
       [\fIargument\fR]...
  .fi
  
  .SH DESCRIPTION
- .sp
  .LP
  The \fBzlogin\fR utility is used by the administrator to enter an operating
  system zone. Only a superuser operating in the global system zone can use this
  utility.
  .sp
  .LP
! \fBzlogin\fR operates in one of three modes:
  .sp
  .ne 2
  .na
  \fBInteractive Mode\fR
  .ad
  .RS 24n
! If no utility argument is given and the stdin file descriptor for the
! \fBzlogin\fR process is a tty device, \fBzlogin\fR operates in \fBinteractive
! mode\fR. In this mode, \fBzlogin\fR creates a new pseudo terminal for use
! within the login session. Programs requiring a tty device, for example,
! \fBvi\fR(1), work properly in this mode. In this mode, \fBzlogin\fR invokes
! \fBlogin\fR(1) to provide a suitable login session.
  .RE
  
  .sp
  .ne 2
  .na
  \fBNon-Interactive Mode\fR
  .ad
  .RS 24n
! If a utility is specified, \fBzlogin\fR operates in \fBnon-interactive mode\fR.
! This mode can be useful for script authors since stdin, stdout, and stderr are
! preserved and the exit status of \fIutility\fR is returned upon termination. In
! this mode, \fBzlogin\fR invokes \fBsu\fR(1M) in order to set up the user's
! environment and to provide a login environment.
  .sp
  The specified command is passed as a string and interpreted by a shell running
  in the non-global zone. See \fBrsh\fR(1).
  .RE
  
--- 11,71 ----
  .\" add the following below this CDDL HEADER, with the fields enclosed by
  .\" brackets "[]" replaced with your own identifying information:
  .\" Portions Copyright [yyyy] [name of copyright owner]
  .\" Copyright 2013 DEY Storage Systems, Inc.
  .\" Copyright (c) 2014 Gary Mills
+ .\" Copyright (c) 2015, Joyent, Inc. All Rights Reserved
  .\" Copyright 2015 Nexenta Systems, Inc. All rights reserved.
! .TH ZLOGIN 1 "Mar 30, 2015"
  .SH NAME
  zlogin \- enter a zone
  .SH SYNOPSIS
  .LP
  .nf
! \fBzlogin\fR [\fB-dCEINQ\fR] [\fB-e\fR \fIc\fR] [\fB-l\fR \fIusername\fR] \fIzonename\fR
  .fi
  
  .LP
  .nf
! \fBzlogin\fR [\fB-inEQS\fR] [\fB-e\fR \fIc\fR] [\fB-l\fR \fIusername\fR] \fIzonename\fR \fIutility\fR
       [\fIargument\fR]...
  .fi
  
  .SH DESCRIPTION
  .LP
  The \fBzlogin\fR utility is used by the administrator to enter an operating
  system zone. Only a superuser operating in the global system zone can use this
  utility.
  .sp
  .LP
! \fBzlogin\fR operates in one of four modes:
  .sp
  .ne 2
  .na
  \fBInteractive Mode\fR
  .ad
  .RS 24n
! If no utility argument is given or if the \fB-i\fR option is specified, and the
! stdin file descriptor for the \fBzlogin\fR process is a tty device, \fBzlogin\fR
! operates in \fBinteractive mode\fR. In this mode, \fBzlogin\fR creates a new
! pseudo terminal for use within the login session. Programs requiring a tty
! device, for example, \fBvi\fR(1), work properly in this mode. In this mode,
! \fBzlogin\fR invokes \fBlogin\fR(1) to provide a suitable login session.
  .RE
  
  .sp
  .ne 2
  .na
  \fBNon-Interactive Mode\fR
  .ad
  .RS 24n
! If a utility is specified and the \fB-i\fR option is not specified, \fBzlogin\fR
! operates in \fBnon-interactive mode\fR.  This mode can be useful for script
! authors since stdin, stdout, and stderr are preserved and the exit status of
! \fIutility\fR is returned upon termination. In this mode, \fBzlogin\fR invokes
! \fBsu\fR(1M) in order to set up the user's environment and to provide a login
! environment.
  .sp
  The specified command is passed as a string and interpreted by a shell running
  in the non-global zone. See \fBrsh\fR(1).
  .RE
  
*** 78,89 ****
  device and \fBzlogin\fR operates in \fBconsole mode\fR. The zone console is
  available once the zone is in the installed  state. Connections to the console
  are persistent across reboot of the zone.
  .RE
  
- .SH OPTIONS
  .sp
  .LP
  The following options are supported:
  .sp
  .ne 2
  .na
--- 79,99 ----
  device and \fBzlogin\fR operates in \fBconsole mode\fR. The zone console is
  available once the zone is in the installed  state. Connections to the console
  are persistent across reboot of the zone.
  .RE
  
  .sp
+ .ne 2
+ .na
+ \fBStandalone-processs Interactive Mode\fR
+ .ad
+ .RS 24n
+ If the \fB-I\fR option is specified the user is connected to the zone's stdin,
+ stdout and stderr \fBzfd(7D)\fR devices.
+ .RE
+ 
+ .SH OPTIONS
  .LP
  The following options are supported:
  .sp
  .ne 2
  .na
*** 125,134 ****
--- 135,163 ----
  .RE
  
  .sp
  .ne 2
  .na
+ \fB\fB-i\fR\fR
+ .ad
+ .RS 15n
+ Forces interactive mode when a utility argument is specified.
+ .RE
+ 
+ .sp
+ .ne 2
+ .na
+ \fB\fB-I\fR\fR
+ .ad
+ .RS 15n
+ Connects to the zone's \fBzfd(7D)\fR devices.
+ .RE
+ 
+ .sp
+ .sp
+ .ne 2
+ .na
  \fB\fB-l\fR \fIusername\fR\fR
  .ad
  .RS 15n
  Specifies a different \fIusername\fR for the zone login. If you do not use this
  option, the zone username used is "root". This option is invalid if the
*** 147,156 ****
--- 176,196 ----
  .RE
  
  .sp
  .ne 2
  .na
+ \fB-N\fR
+ .ad
+ .RS 15n
+ Nohup. This may only be used with the -I option to avoid sending EOF to the zfd
+ device when zlogin's stdin receives EOF. It can also be toggled by sending
+ \fBSIGUSR1\fR to an attached zlogin process.
+ .RE
+ 
+ .sp
+ .ne 2
+ .na
  \fB-Q\fR
  .ad
  .RS 15n
  Specifies quiet mode operation.  In quiet mode, extra messages indicating the
  the function of \fBzlogin\fR will not be displayed, giving the possibility
*** 170,180 ****
  console logins. This mode should only be used to recover a damaged zone when
  other forms of login have become impossible.
  .RE
  
  .SS "Escape Sequences"
- .sp
  .LP
  Lines that you type that start with the tilde character (\fB~\fR) are "escape
  sequences". The escape character can be changed using the \fB-e\fR option.
  .sp
  .ne 2
--- 210,219 ----
*** 185,200 ****
  Disconnects from the zone. This is not the same as a logout, because the local
  host breaks the connection with no warning to the zone's end.
  .RE
  
  .SH SECURITY
- .sp
  .LP
  Once a process has been placed in a zone other than the global zone, the
  process cannot change zone again, nor can any of its children.
  .SH OPERANDS
- .sp
  .LP
  The following operands are supported:
  .sp
  .ne 2
  .na
--- 224,237 ----
*** 221,231 ****
  .RS 15n
  Arguments passed to the utility.
  .RE
  
  .SH EXIT STATUS
- .sp
  .LP
  In interactive and non-interactive modes, the \fBzlogin\fR utility exits when
  the command or shell in the non-global zone exits. In non-interactive mode, the
  exit status of the remote program is returned as the exit status of
  \fBzlogin\fR. In interactive mode and console login mode, the exit status is
--- 258,267 ----
*** 266,276 ****
  Return code from utility, or from \fBsu\fR(1M) if operating in non-interactive
  mode.
  .RE
  
  .SH ATTRIBUTES
- .sp
  .LP
  See \fBattributes\fR(5) for descriptions of the following attributes:
  .sp
  
  .sp
--- 302,311 ----
*** 282,296 ****
  _
  Interface Stability     Evolving
  .TE
  
  .SH SEE ALSO
- .sp
  .LP
  \fBlogin\fR(1), \fBrsh\fR(1), \fBvi\fR(1), \fBsu\fR(1M), \fBzoneadm\fR(1M),
  \fBzonecfg\fR(1M), \fBattributes\fR(5), \fBzones\fR(5)
  .SH NOTES
- .sp
  .LP
  \fBzlogin\fR fails if its open files or any portion of its address space
  corresponds to an NFS file. This includes the executable itself or the shared
  libraries.
--- 317,329 ----