CentOS 6系まではプロセスの起動は init スクリプト (/etc/init.d/) を利用していましたが、 CentOS 7系では systemctl コマンドを利用する方針に変更されています。また、chkconfig コマンドも廃止され、systemctl コマンドに統合されました。このあたりの手順をhttpdを例として 確認します。
■httpd起動(&起動確認)
[root@centos70 ~]# systemctl start httpd.service [root@centos70 ~]# systemctl status httpd.service httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled) Active: active (running) since Sat 2014-07-25 15:33:43 JST; 5s ago Main PID: 2750 (httpd) Status: "Processing requests..." CGroup: /system.slice/httpd.service |-2750 /usr/sbin/httpd -DFOREGROUND |-2751 /usr/sbin/httpd -DFOREGROUND |-2752 /usr/sbin/httpd -DFOREGROUND |-2753 /usr/sbin/httpd -DFOREGROUND |-2754 /usr/sbin/httpd -DFOREGROUND `-2755 /usr/sbin/httpd -DFOREGROUND Jul 25 15:33:43 centos70 systemd[1]: Starting The Apache HTTP Server... Jul 25 15:33:43 centos70 httpd[2750]: AH00558: httpd: Could not reliably determine the server's fully qualified...essage Jul 25 15:33:43 centos70 systemd[1]: Started The Apache HTTP Server. Hint: Some lines were ellipsized, use -l to show in full. [root@centos70 ~]#
## ブラウザでの確認
※事前にFireWallサービスを停止しておく
[root@centos70 ~]# systemctl stop firewalld.service
■httpd停止(&停止確認)
[root@centos70 ~]# systemctl stop httpd.service [root@centos70 ~]# systemctl status httpd.service httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled) Active: inactive (dead) Jul 25 15:32:17 centos70 systemd[1]: Starting The Apache HTTP Server... Jul 25 15:32:18 centos70 httpd[2713]: AH00558: httpd: Could not reliably determine the server's fully qualified...essage Jul 25 15:32:18 centos70 systemd[1]: Started The Apache HTTP Server. Jul 25 15:33:08 centos70 systemd[1]: Stopping The Apache HTTP Server... (以下略)
■httpd自動起動設定(&設定確認)
[root@centos70 ~]# systemctl enable httpd.service ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service' [root@centos70 ~]# systemctl list-unit-files | grep httpd httpd.service enabled [root@centos70 ~]#
■httpd自動起動解除(&設定確認)
[root@centos70 ~]# systemctl disable httpd.service rm '/etc/systemd/system/multi-user.target.wants/httpd.service' [root@centos70 ~]# systemctl list-unit-files | grep httpd httpd.service disabled [root@centos70 ~]#
こちらの情報が何かのお役に立てましたら幸いです。サイト継続ご協力のほどお願い致します。m(_ _)m
0 件のコメント:
コメントを投稿