私はいつもグラフィカルインターフェイスなしでテキスト+コンソールを使い始めました。これにはログインが含まれます。これはログイン時にいくつかの同期を実行するため、特にファイルを介して以下をtty1
実行する自動ログインスクリプトがある場合はテキストです。/etc/systemd/system/[email protected]/override.conf
/usr/sbin/agetty --autologin <myusername> --noclear %I 38400 linux
私はFedora 36(35から)にアップグレードしましたが、最後のステップまでブートがスムーズでした。テキストログインプロンプトを表示する代わりに、左上隅に下線付きの黒い画面が表示されます。
なぜ?
systemctl
赤い線を除いて、コマンドは正常に実行されます。
● [email protected] loaded failed failed Getty on tty1
ログに次のエラーが表示されます。
agetty[4565]: /dev/tty1: "cannot get controlling tty: Operation not permitted"
agetty[4565]: setting terminal attributes failed: Input/output error
rootとしてログインしようとするたびに、コンソールにこのエラーが表示されます。
service [email protected] start
何が間違っているのかわかりませんが、agettyコマンドが変更されたようです。
編集する:
次の行を入力すると:
ExecStart=-/usr/sbin/agetty --autologin <myusername> --noclear tty1 38400 linux
ファイルで自動ログインが有効です。しかし、私が次に変更した場合/etc/systemd/system/[email protected]/override.conf
ExecStart=-/home/<myusername>/bin/myautologinscript.sh
同じラインではそうではありません!
ベストアンサー1
cannot get controlling tty: Operation not permitted
このエラーは、端末デバイスがセッションの制御端末になっていない場合に返されます。agetty
agetty
TIOCSCTTY
ioctl()
agetty
ioctl()
端末が現在セッションを制御していないか、pid以外のIDでセッションを制御する場合、agetty
問題が発生します。
tty_ioctl(2)
マニュアルページから:
TIOCSCTTY Argument: int arg Make the given terminal the controlling terminal of the calling process. The calling process must be a session leader and not have a controlling terminal already. For this case, arg should be specified as zero. If this terminal is already the controlling terminal of a dif‐ ferent session group, then the ioctl fails with EPERM, unless the caller has the CAP_SYS_ADMIN capability and arg equals 1, in which case the terminal is stolen, and all processes that had it as controlling terminal lose it.
agetty
したがって、セッションリーダーでなければ動作しません。
agetty
直接実行するのではなく、子プロセスで実行されるスクリプトを起動すると、シェルはセッションリーダーになりますが、agetty
そうagetty
ではありません。
usingはexec agetty
シェルと同じプロセスで実行されagetty
(シェルを置き換える)agetty
セッションリーダーになります。
これが以前のバージョンのFedoraで同じように機能していた場合、私の意見ではフラグなしで呼び出して、端末systemd
デバイスをセッションの制御端末にしました。しかし、それにもかかわらず、会議の進行者ではないことは悪い考えのように聞こえます。open()
O_NOCTTY
agetty
(この場合、制御されたセッションはまだagetty
pidと一致しないため、まだエクスポートしようとしますTIOCSCTTY
。現在、他の説明はありません。)