CentOS7 からの変更点 #1 (service コマンド)
CentOS7 からの変更点についてメモ
service コマンドから systemctl コマンドへ
systemd の導入によって service コマンドの使用から systemctl が推奨になった。
| 操作 | ~CentOS6 | CentOS7~ |
|---|---|---|
| 起動 | service hoge start | systemctl start hoge |
| 停止 | service hoge stop | systemctl stop hoge |
| 再起動 | service hoge restart | systemctl restart hoge |
| 確認 | service hoge status | systemctl status hoge |
| 設定反映 | service hoge reload | systemctl reload hoge |
強制終了も以下のとおり。
| 操作 | ~CentOS6 | CentOS7~ |
|---|---|---|
| 強制終了 | kill -9 HOGE_PID | systemctl kill -s 9 hoge |
統一されたのね!
ちなみに service コマンドでも動く。
…が sysytemctl へのリダイレクトで有ることが表示される。
[root@fuga ~]# service postfix status
Redirecting to /bin/systemctl status postfix.service
postfix.service - Postfix Mail Transport Agent
Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled)
Active: active (running) since 木 2015-02-26 12:41:06 JST; 35min ago
Process: 1512 ExecStart=/usr/sbin/postfix start (code=exited, status=0/SUCCESS)
Process: 1507 ExecStartPre=/usr/libexec/postfix/chroot-update (code=exited, status=0/SUCCESS)
Process: 1159 ExecStartPre=/usr/libexec/postfix/aliasesdb (code=exited, status=0/SUCCESS)
Main PID: 1815 (master)
CGroup: /system.slice/postfix.service
├─1815 /usr/libexec/postfix/master -w
├─1903 pickup -l -t unix -u
└─1904 qmgr -l -t unix -u
2月 26 12:40:04 fuga.com systemd[1]: Starting Postfix Mail Transport Agent...
2月 26 12:40:06 fuga.com postfix/master[1815]: daemon started -- version 2.10.1, configuration /etc/postfix
2月 26 12:40:06 fuga.com systemd[1]: Started Postfix Mail Transport Agent.

CentOS 7実践ガイド (impress top gear)
- 作者: 古賀政純
- 出版社/メーカー: インプレス
- 発売日: 2015/02/25
- メディア: 単行本(ソフトカバー)
- この商品を含むブログ (1件) を見る