AGETTY(8) AGETTY(8)
名前
agetty - Linux 用 getty のもう一つの実装
書式
agetty [-ihLmnw] [-f issue_file] [-l login_program] [-I init] [-t time-
out] port baud_rate,... [term]
agetty [-ihLmnw] [-f issue_file] [-l login_program] [-I init] [-t time-
out] baud_rate,... port [term]
説明
agetty は tty ポートをオープンし、ログイン名を求めるプロンプトを出し、
/bin/login コマンドを起動する。通常 agetty は init(8) から起動される。
agetty はいくつか非標準な機能を持っており、直結ラインやダイアルインのラ
インに便利になっている。
o ログイン名を読むときに tty の設定(パリティビット、 erase、 kill
、 end-of-line、 uppercase 文字)を行う。 agetty は 7 ビット文字
を偶、奇、スペースの各パリティ、あるいはパリティなしのいずれでも
扱うことができる。また 8 ビット文字をパリティなしで扱うことが で
きる。以下の特殊文字を認識する; @ および コントロール U (kill)、
#、 DEL およびバックスペース (erase)、復帰 (carriage return) お
よび改行 (linefeed) (end of line)。
o オプション機能: Hayes(tm) 互換のモデムが出す CONNECT メッセージ
から通信速度 (baud rate) を推測する。
o オプション機能: すでにオープンしているラインを与えられた場合には
ラインを切断しない (コールバックの用途に便利)。
o オプション機能: /etc/issue ファイルの内容を表示させない。
o オプション機能: /etc/issue 以外の issue ファイルを表示する。
o オプション機能: ログイン名を尋ねない。
o オプション機能: /bin/login 以外の非標準なログインプログラムを起
動する。
o オプション機能: ハードウェアによるフローコントロールを有効にする
。
o オプション機能: 接続ラインをローカルなライン (キャリア検知を必要
としないライン) に設定する。
このプログラムは /etc/gettydefs (System V) や /etc/gettytab (SunOS 4)
ファイルを利用しない。
port /dev/ ディレクトリからの相対パス名。 "-" が指定されると、 agetty
は自分の標準入力がすでに tty ポートに接続されており、リモート ユ
ーザーへの接続がすでに確立されているものとみなす。
System V では port 引き数としての "-" は "--" の前に置かなければ
ならない。
baud_rate,...
一つ以上の通信速度をコンマで区切ったリスト。 agetty が BREAK 文
字を受け取ると、リストの次に進む。最後まで行ったら最初に戻る。
通 信 速度は大きい方から小さい方へと並べるようにする。こうすると
null 文字 (Ctrl-@) も通信速度の切り替えに使えるようになる。
term TERM 環境変数に用いる値。これは init(8) の設定を上書きし、 login
および shell に受け継がれる。
オプション
-h ハードウェア (RTS/CTS) コントロールを有効にする。ソフトウェアに
よる (XON/XOFF) フローコントロールを無効にするかどうかはアプリケ
ーションに任せる。
-i ログインプロンプトの前に /etc/issue の内容を表示しない。端末や通
信装置は、正しくない通信速度で大量のテキストを受け取ると混乱して
しまうことがある。ダイアルアップスクリプトによっては、ログインプ
ロンプトの前に大量のテキストを受け取ると落ちてしまう場合がある。
-f issue_file
issue_file を /etc/issue の代わりに表示する。端末別にメッセージ
を変えることができるようになる。 -i オプションはこのオプションを
上書きする。
-I initstring
通 信に先立って tty やモデムに送る初期化文字列を設定する。これは
モデムの初期化に用いることができる。印刷できない文字も、バックス
ラッシュ (\) に引き続いて 8 進数で指定すれば送ることができる。例
えば改行文字 (ASCII 10, 8 進数では 012) を送るには \012 とする。
-l login_program
指 定した login_program を /bin/login の代わりに起動する。これに
よって非標準なログインプログラム (例えばダイアルアップパスワード
を 尋 ねたり、 /etc/passwd 以外のパスワードファイルを用いるなど)
を使うことができる。
-m 通信速度を Hayes(tm) 互換モデムが出す CONNECT メッセージから抽出
しようと試みる。メッセージは "<その他><速度><その他>" というよう
な形式になっている。 agetty では、コマンドラインの baud_rate の
先頭に指定されたスピードで、モデムがステータスメッセージを出力す
るものとみなしている。
-m の機能は負荷の高いシステムでは失敗することもあるので、コマ ン
ド ラインでも予想される通信速度をすべて列記して、 BREAK 処理を有
効にしておく方が良いだろう。
-n ログイン名入力のプロンプトを出さない。これは -l オプションと共に
用 いて、 BBS システムのように非標準のログイン処理を起動する際に
便利である。 -n オプションを用いると、 agetty はログインしてくる
ユーザーから入力を受け取ることができないので、コネクションのパリ
ティやキャラクタビット数、改行処理などを決定することができない。
デ フォルトはスペースパリティ、文字は 7 ビット、行末文字は ASCII
の CR (13) となっている。 agetty が起動するプログラム ( 通 常 は
/bin/login) は root 権限で実行されることに注意せよ。
-t timeout
timeout 秒以内にユーザー名を読み込むことができなかったら切断する
。このオプションは直結回線には用いない方が良いだろう。
-L 接続回線を、キャリア検知の必要がないローカルな直結回線であるとみ
なす。これはローカルに接続された端末で、キャリア検知用の信号線が
ないシリアルケーブルを使っているときに便利である。
-w ユーザーまたはモデムからの復帰文字か改行文字を待ち、これを受け取
っ てから /etc/issue (または別の issue) ファイルやログインプロン
プトを出す。 -I オプションを用いた接続の際に非常に便利。
例
この節では /etc/inittabファイルに記述するコマンドエントリの例を示す。他
の フ ィ ールドには、それぞれ適当な値を指定する必要があるだろう。詳細は
inittab(5) を参照すること。
直結ラインまたはコンソール tty 用:
/sbin/agetty 9600 ttyS1
直結された端末で、正しい CD 線のない場合 (password: プロンプトが出な い
で端末が黙ってしまう場合はこちらを試してみると良い):
/sbin/agetty -L 9600 ttyS1 vt100
9600/2400/1200 bps のモデムを用いた古いスタイルのダイアルイン接続ライン
/sbin/agetty -mt60 ttyS1 9600,2400,1200
Hayes モデムで、マシンへのインターフェースが 115200 bps に固定されて い
る 場合 (以下の例の初期文字列ではモデムのエコーとリザルトコードを抑止し
、モデム/コンピュータ間の DCD はモデム/モデム間の DCD に追随するよう に
し 、 DTR が落ちた場合は切断とベル 1 回での自動応答機能を有効にするよう
に設定している):
/sbin/agetty -w -I ’ATE0Q1&D2&C1S0=1\015’ 115200 ttyS1
ISSUE で利用できるエスケープ
issue ファイル (/etc/issue または -f オプションで設定されたファイル) で
は システム名や日付、時間などを表示するエスケープコードを用いることがで
きる。エスケープコードはバックスラッシュ (\) とそれに続く一文字からなる
。文字は以下のうちのどれか。
b 現在のラインの通信速度。
d 現在の日付。
s システム名 (オペレーティングシステムの名前)。
l 現在の tty ラインの名前。
m マシンのアーキテクチャを表す名前 (例: i486)。
n マシンのノード名 (ホスト名)。
o マシンのドメイン名。
r OS のリリース番号 (例: 1.1.9)。
t 現在の時刻。
u 現在ログインしているユーザー数。
U 文字列 "1 user" または "
AGETTY(8) AGETTY(8)
NAME
agetty - alternative Linux getty
SYNOPSIS
agetty [-8ihLmnUw] [-f issue_file] [-l login_program] [-I init] [-t
timeout] [-H login_host] port baud_rate,... [term]
agetty [-8ihLmnw] [-f issue_file] [-l login_program] [-I init] [-t
timeout] [-H login_host] baud_rate,... port [term]
DESCRIPTION
agetty opens a tty port, prompts for a login name and invokes the
/bin/login command. It is normally invoked by init(8).
agetty has several non-standard features that are useful for hard-wired
and for dial-in lines:
o Adapts the tty settings to parity bits and to erase, kill, end-
of-line and uppercase characters when it reads a login name.
The program can handle 7-bit characters with even, odd, none or
space parity, and 8-bit characters with no parity. The following
special characters are recognized: @ and Control-U (kill); #,
DEL and back space (erase); carriage return and line feed (end
of line). See also --erase-chars and --kill-chars options.
o Optionally deduces the baud rate from the CONNECT messages pro-
duced by Hayes(tm)-compatible modems.
o Optionally does not hang up when it is given an already opened
line (useful for call-back applications).
o Optionally does not display the contents of the /etc/issue file.
o Optionally displays an alternative issue file instead of
/etc/issue.
o Optionally does not ask for a login name.
o Optionally invokes a non-standard login program instead of
/bin/login.
o Optionally turns on hard-ware flow control
o Optionally forces the line to be local with no need for carrier
detect.
This program does not use the /etc/gettydefs (System V) or /etc/get-
tytab (SunOS 4) files.
ARGUMENTS
port A path name relative to the /dev directory. If a "-" is speci-
fied, agetty assumes that its standard input is already con-
nected to a tty port and that a connection to a remote user has
already been established.
Under System V, a "-" port argument should be preceded by a
"--".
baud_rate,...
A comma-separated list of one or more baud rates. Each time
agetty receives a BREAK character it advances through the list,
which is treated as if it were circular.
Baud rates should be specified in descending order, so that the
null character (Ctrl-@) can also be used for baud rate switch-
ing.
term The value to be used for the TERM environment variable. This
overrides whatever init(8) may have set, and is inherited by
login and the shell.
OPTIONS
-8 Assume that the tty is 8-bit clean, hence disable parity detec-
tion.
-h Enable hardware (RTS/CTS) flow control. It is left up to the
application to disable software (XON/XOFF) flow protocol where
appropriate.
-i Do not display the contents of /etc/issue (or other) before
writing the login prompt. Terminals or communications hardware
may become confused when receiving lots of text at the wrong
baud rate; dial-up scripts may fail if the login prompt is pre-
ceded by too much text.
-E If -H fakehost option is given then -h fakehost options is added
to the the /bin/login command line.
-f issue_file
Display the contents of issue_file instead of /etc/issue. This
allows custom messages to be displayed on different terminals.
The -i option will override this option.
-I initstring
Set an initial string to be sent to the tty or modem before
sending anything else. This may be used to initialize a modem.
Non printable characters may be sent by writing their octal code
preceded by a backslash (\). For example to send a linefeed
character (ASCII 10, octal 012) write \012.
-l login_program
Invoke the specified login_program instead of /bin/login. This
allows the use of a non-standard login program (for example, one
that asks for a dial-up password or that uses a different pass-
word file).
-H login_host
Write the specified login_host into the utmp file. (Normally, no
login host is given, since agetty is used for local hardwired
connections and consoles. However, this option can be useful for
identifying terminal concentrators and the like.
-L [=mode]
Control CLOCAL line flag, the optional argument mode is ’auto’,
’always’ or ’never’. If the mode argument is omitted then the
default is ’always’. If the -L option is ommitted at all then
the default is ’auto’.
The mode ’always’ forces the line to be a local line with no
need for carrier detect. This can be useful when you have a
locally attached terminal where the serial line does not set the
carrier detect signal.
The mode ’never’ explicitly clears CLOCAL flags from line set-
ting and the carrier detect signal is expected on the line.
The mode ’auto’ (agetty default) does not modify CLOCAL setting
and follows the setting enabled by kernel.
-m Try to extract the baud rate the CONNECT status message produced
by Hayes(tm)-compatible modems. These status messages are of the
form: "
コロナウイルスの日ごとの感染者数・死者数をグラフ化してみました。どの国が増加傾向にあり、どの国が終息に向かっているかを視覚化しています。
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa