(1)サービス関連
・サービスの起動
# systemctl start httpd
※ただ、うまくいっても何も反応してくれない。
なので、statusを確認する必要がある。
・サービスの状態確認
#systemctl status httpd
動いていると、active(running)と表示される。
・サービスの停止
# systemctl stop httpd
・再起動
# systemctl restart httpd
・自動起動の設定
# systemctl enable httpd ←on
# systemctl disable httpd ←off
※古いコマンドも一応、使える。ただし、上記のコマンドにリダイレクトされたよ!とメッセージが出る
# chkconfig httpd on
・自動起動が設定しているかの確認にはis-enabledを使う
#systemctl is-enabled named
disabled
↑はEnableになっていない
・自動起動の一覧表示
# systemctl list-unit-files -t service
ただ、たくさんでてくるので、httpdだけを見たいなら、パイプで | grep httpd としましょう。
古いコマンドの chkconfig --listだと、全部が見えないので、実質、使えない。
■システムの停止 shutdownコマンド
・以下を実行したら、ユーザがログイン中とでた。'systemctl poweroff -i'を使えとある。
#shutdown -h now
User xxx is logged in ~
Please retry operation after closing inhibitors and logging out other users.
Alternatively, ignore inhibitors and users with 'systemctl poweroff -i'.
・-iオプションをhelpで見た
#systemctl poweroff -h
すると、以下のようにinhibitors(阻害物)を無視(ignore)するとある
-i --ignore-inhibitors When shutting down or sleeping, ignore inhibitors
・サービスの起動
# systemctl start httpd
※ただ、うまくいっても何も反応してくれない。
なので、statusを確認する必要がある。
・サービスの状態確認
#systemctl status httpd
動いていると、active(running)と表示される。
・サービスの停止
# systemctl stop httpd
・再起動
# systemctl restart httpd
・自動起動の設定
# systemctl enable httpd ←on
# systemctl disable httpd ←off
※古いコマンドも一応、使える。ただし、上記のコマンドにリダイレクトされたよ!とメッセージが出る
# chkconfig httpd on
・自動起動が設定しているかの確認にはis-enabledを使う
#systemctl is-enabled named
disabled
↑はEnableになっていない
・自動起動の一覧表示
# systemctl list-unit-files -t service
ただ、たくさんでてくるので、httpdだけを見たいなら、パイプで | grep httpd としましょう。
古いコマンドの chkconfig --listだと、全部が見えないので、実質、使えない。
■システムの停止 shutdownコマンド
・以下を実行したら、ユーザがログイン中とでた。'systemctl poweroff -i'を使えとある。
#shutdown -h now
User xxx is logged in ~
Please retry operation after closing inhibitors and logging out other users.
Alternatively, ignore inhibitors and users with 'systemctl poweroff -i'.
・-iオプションをhelpで見た
#systemctl poweroff -h
すると、以下のようにinhibitors(阻害物)を無視(ignore)するとある
-i --ignore-inhibitors When shutting down or sleeping, ignore inhibitors
コメント