2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

startx で X を自動起動する

Last updated at Posted at 2019-07-31

動機

使用しているノートパソコンに Fedora をインストールしているが、GUI 起動ができないため

実施項目

以下の設定をするだけです。

/etc/profile.d/sh.local
# Add any required envvar overrides to this file, it is sourced from /etc/profile
if [ "${LANG}" != "ja_JP.utf8" ]; then
    export LANG=ja_JP.utf8
fi
if [[ -z "${DISPLAY}" && "${XDG_VTNR}" -eq 1 ]]; then
    exec startx
fi

(参考)
xinit-Archwiki

/etc/profile を解読する

/usr/bin/id が実行可能であれば以下を実行
  EUID が空ならば、以下を実行
    EUID に /usr/bin/id -u と、UID に /usr/bn/id -ru を設定
    USER に usr/bin/id  -un を設定
    LOGNAME に USER を設定
    MAIL に /var/spool/mail/$USER を設定

EUID が 0 ならば、以下を実行
  PATH に /usr/sbin がなければ、PATH の最初に /usr/sbin を追加
  PATH に /usr/local/sbin がなければ、PATH の最初に /usr/local/sbin を追加 
上記以外なら、以下を実行
  PATH に /usr/local/sbin がなければ、PATH の最後に /usr/local/sbin を追加
  PATH に /usr/sbin がなければ、PATH の最後に /usr/sbin を追加

HOSTNAME に、/usr/bin/hostname の結果を設定
HISTSIZE に 1000 を設定
HISTCONTROL が ignorespace なら、以下を実行
  export HISTCONTROL=ignoreboth を実行
上記以外なら、以下を実行
  export HISTCONTROL=ignoredups を実行
次のコマンドを実行
  export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL

UID が 199 より大きく、id -gn と id -un が等しいならば、以下を実行
  umask 002
上記以外なら、以下を実行
  umask 022

/etc/profile.d/ 配下のスクリプトの実行
  その際、以下をチェック
      "${-#*i}" と "$-" が等しくなければ、以下を実行($- は bashオプション)
           各スクリプトを順番に実行して結果を表示する
        上記以外なら、以下を実行
           各スクリプトを順番に実行するが、結果を表示しない
        この際、最後に、/etc/profile.d/sh.local を実行 ★<-- ここに記述するとよい

BASH_VERSION が空でなければ、以下を実行
 /etc/bashrc が存在すれば、/etc/bashrc を実行

man 7 bootup

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?