====== CentOS 7.xのサービス設定(systemctl) ====== {{tag>centos7}} CentOS 6.xでは、''service''や''chkconfig''コマンドで行っていたサービスの設定を、 CentOS 7.xでは''systemctl''コマンドで実行する。 ===== 有効なサービスの一覧表示と検索 ===== systemctl list-units [検索パターン] ===== インストール済みサービスの一覧表示と検索 ===== systemctl list-unit-files [検索パターン] ===== サービスの状態表示 ===== systemctl status httpd.service ===== サービスの有効化/無効化 ===== systemctl enable httpd.service systemctl disable httpd.service ===== サービスの開始/停止 ===== systemctl start httpd.service systemctl stop httpd.service systemctl restart httpd.service ===== サイト固有のユニットファイルを追加する場所 ===== サイト固有のユニットファイルを作成した場合は''/etc/systemd/system''に置く。 置いた後は''systemctl daemon-reload''を実行してユニットファイルを再読み込みする。