0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Linux、諸々設定(個人メモ)

0
Posted at

はじめに

いろんな設定が混ざってきたので整理します

設定整理

管理方式 起動レベル / ターゲット サービス起動 ファイルシステム設定 マウント実行 カーネルパラメータ
SysV-init /etc/inittab
GRUBのカーネル引数
/etc/init.d/
/etc/rc?.d/
chkconfig
/etc/fstab mount コマンド
mount -a
/etc/sysctl.conf
systemd systemctl set-default
target
systemctl enable
.service
/etc/fstab
.mountユニット
mount コマンド
systemctl start xxx.mount
/etc/sysctl.conf

具体例

起動レベル / ターゲットから、サービス起動まで

SysV-init

① カーネル起動 → init プロセス開始
/sbin/initが実行されて、最初のユーザープロセスとしてinitが起動する。
② init が /etc/inittab を読み込む
initが設定ファイルを読み込む。
(例:id:5:initdefault:
③指定されたランレベルのディレクトリへ移動
etc/rc5.d等のランレベルに応じたディレクトリを参照。
④rcディレクトリ内のスクリプトを順番に実行
S55sshd → /etc/init.d/sshdのように、起動スクリプトのシンボリックリンクから実体にアクセス
/etc/inittabの

ファイルシステム設定から、マウント実行まで

①ファイルシステムでマウントの設定をする
/etc/fstabに、UUID=xxxx-xxxx /data ext4 defaults 0 2と入力。

②rc.sysinit内でmount実行カーネル起動

カーネル起動

/sbin/init 起動

/etc/inittab 読み込み

/etc/rc.sysinit 実行

mount -aで、/etc/fstabをもとに一括マウント

カーネルパラメータ設定

①設定ファイルに設定
/etc/sysctl.confで、
net.ipv4.ip_forward = 1
vm.swappiness = 10
のように設定。

②設定を反映
sysctl -pや、起動時に/etc/rc.sysinitで自動反映。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?