- 追加された行はこの色です。
- 削除された行はこの色です。
*CentOS7について [#i02d8bc4]
RIGHT:更新日 &lastmod();
**CentOS7の起動について [#x3e4a595]
UNIX System V系のinit→ systemdにより「ランレベル」から「ターゲット」に変更された。
***起動モードの確認 [#i5413f7b]
# systemctl get-default
graphical.target
System V系のランレベル5
***ターゲットの確認 [#vfc8e7b0]
# systemctl list-units --type=target --all --no-pager
# systemctl list-units -t target -a --no-pager
UNIT LOAD ACTIVE SUB DESCRIPTION
basic.target loaded active active Basic System
cryptsetup.target loaded active active Encrypted Volumes
emergency.target loaded inactive dead Emergency Mode
final.target loaded inactive dead Final Step
getty.target loaded active active Login Prompts
graphical.target loaded active active Graphical Interface
local-fs-pre.target loaded active active Local File Systems (Pre)
local-fs.target loaded active active Local File Systems
multi-user.target loaded active active Multi-User System
network-online.target loaded inactive dead Network is Online
network.target loaded active active Network
(中略)
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
27 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.
***起動モードの変更(graphical→multi-user [runlevel5→runlevel3] [#s2bea787]
# systemctl set-default multi-user.target
rm '/etc/systemd/system/default.target'
ln -s '/usr/lib/systemd/system/multi-user.target' '/etc/systemd/system/default.target'
# systemctl get-default
multi-user.target
***CUIからGUIに切り替え [#tfeeaf7c]
# systemctl isolate graphical.target
***ランレベルとsystemdの対応 [#g00441d5]
| | runlevel | systemdでの変更コマンド |
|システム停止 | 0 | systemctl isolate poweroff.target |
|シングルユーザモード | 1 | systemctl isolate rescue.target |
|マルチユーザモード | 3 | systemctl isolate multi-user.target |
|グラフィカルユーザモード | 5 | systemctl isolate graphical.target |
|再起動 | 6 | systemctl isolate reboot.target |
|緊急モード | - | systemctl isolate emergency.target |
CENTER:| |runlevel | systemdでの変更コマンド |h
|システム停止 | 0 | systemctl isolate poweroff.target |
|シングルユーザモード | 1 | systemctl isolate rescue.target |
|マルチユーザモード | 3 | systemctl isolate multi-user.target |
|グラフィカルユーザモード | 5 | systemctl isolate graphical.target |
|再起動 | 6 | systemctl isolate reboot.target |
|緊急モード | - | systemctl isolate emergency.target |
***デーモン起動/確認等 [#i11fe6a6]
CENTER:| | SystemV系 | systemd |
|サービス開始 | /etc/rc.d/ini.d/httpd start | systemctl start httpd |
|サービス停止 | /etc/rc.d/ini.d/httpd stop | systemctl stop httpd |
|サービス再起動 | /etc/rc.d/ini.d/httpd restart | systemctl restart httpd |
|設定ファイルの再読み込み | /etc/rc.d/ini.d/httpd reload | systemctl relaod httpd |
|サービス状態 | /sbin/chkconfig httpd status | systemctl status httpd |
|サービス自動起動 | /sbin/chkconfig httpd on | systemctl enable httpd |
|サービス自動起動停止 | /sbin/chkconfig httpd off | systemctl disable httpd |
|ランレベル毎のサービスの有効無効表示 | /sbin/chkconfig --list | systemctl -t services list-unit-files |
|ランレベル毎の指定サービスの有効無効表示 | /sbin/chkconfig --list httpd | systemctl -t services list-unit-files (パイプ) grep httpd |
**参考 [#v3245b06]
http://thinkit.co.jp/story/2014/12/11/5388