<?xml version="1.0" encoding="UTF-8"?>
<!-- **************************************************************************
.... For copyright and licensing terms, see the file named COPYING.
.... **************************************************************************
.-->
<?xml-stylesheet href="docbook-xml.css" type="text/css"?>

<refentry id="login-prompt">

<refmeta xmlns:xi="http://www.w3.org/2001/XInclude">
<refentrytitle>login-prompt</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="manual">user commands</refmiscinfo>
<refmiscinfo class="source">nosh</refmiscinfo>
<xi:include href="version.xml" />
</refmeta>

<refnamediv><refname>login-prompt</refname><refpurpose>simple chain-load getty for prompting before login</refpurpose></refnamediv>

<refsynopsisdiv>
<cmdsynopsis>
<command>login-prompt</command> <arg choice='req'><replaceable>next-prog</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<refsection><title>Description</title>

<para>
<command>login-prompt</command> is a chain-loading utility that prompts to standard output, waits for standard input to have data ready, flushes standard input with the <citerefentry><refentrytitle>tcflush</refentrytitle><manvolnum>3</manvolnum></citerefentry> function, and then (if successful) chain loads to <replaceable>next-prog</replaceable> with the <citerefentry><refentrytitle>execvp</refentrytitle><manvolnum>3</manvolnum></citerefentry> function.
</para>

<para>
<replaceable>next-prog</replaceable> may contain its own command line options, which <command>login-prompt</command> will ignore.
</para>

<para>
This program is primarily used in TTY login services, but is only necessary therein if <replaceable>next-prog</replaceable> has timeout functionality that cannot be switched off, as is the case for FreeBSD <filename>/usr/bin/login</filename>.
<command>login-prompt</command> effectively delays running that program, and commencing the timeout, until the user has responded to a prompt.
This prevents login processes that timeout from continually respawning on unused terminals.
</para>

<para>
This can be used as a means to defer running a login program until a user has actually presssed Enter on a terminal.
</para>

<para>
<command>login-prompt</command> expects the terminal and the line discipline to be in relatively sane states.
To reset to these states, run <citerefentry><refentrytitle>vc-reset-terminal</refentrytitle><manvolnum>1</manvolnum></citerefentry> or <citerefentry><refentrytitle>reset</refentrytitle><manvolnum>1</manvolnum></citerefentry> before <command>login-prompt</command>.
</para>

</refsection><refsection><title>Author</title>
<para><author><personname><firstname>Jonathan</firstname> <surname>de Boyne Pollard</surname></personname></author></para>
</refsection>

</refentry>
