このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
|
centos:systemctl [2020/05/28 15:33] y2sunlight [systemctlのユースケース] |
centos:systemctl [2020/06/04 11:30] (現在) y2sunlight [systemctlのユースケース] |
||
|---|---|---|---|
| 行 4: | 行 4: | ||
| --- // | --- // | ||
| - | [[centos: | + | [[centos: |
| - | systemd は RHEL7CentOS7で使われているサービスを管理するデーモンです。'' | + | systemd は RHEL7/ |
| また、systemctl に触れる機会は既存サービスのメンテナンスの時だけに限りません。自作のWebAPIを公開する時などもサービスを自作しなければならいので使っています。兎に角、CentOS7 になってから systemctl はよく使うようになりました。 | また、systemctl に触れる機会は既存サービスのメンテナンスの時だけに限りません。自作のWebAPIを公開する時などもサービスを自作しなければならいので使っています。兎に角、CentOS7 になってから systemctl はよく使うようになりました。 | ||
| + | 関連記事 | ||
| + | |||
| + | * [[centos: | ||
| + | * [[centos: | ||
| + | * systemctl --- サービスの操作 | ||
| + | * [[centos: | ||
| + | * [[centos: | ||
| リンク | リンク | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| - | * [[https:// | ||
| ---- | ---- | ||
| 行 32: | 行 38: | ||
| ===== systemctlのユースケース ===== | ===== systemctlのユースケース ===== | ||
| - | {{fa> | + | === サービスの操作 === |
| - | < | + | |
| - | systemctl list-units --type=service | + | |
| - | </ | + | |
| - | {{fa> | + | 形式: '' |
| - | < | + | |
| - | systemctl list-unit-files --type=service | + | * COMMAND --- コマンド名(以下にケース毎に記載) |
| - | </ | + | * UNIT--- ユニット名(以下の例では '' |
| {{fa> | {{fa> | ||
| 行 50: | 行 53: | ||
| {{fa> | {{fa> | ||
| < | < | ||
| - | systemctl start sshd.service | + | systemctl start sshd # 起動 |
| - | systemctl stop sshd.service | + | systemctl stop sshd # 終了 |
| - | systemctl restart sshd.service | + | systemctl restart sshd # 再起動 |
| </ | </ | ||
| {{fa> | {{fa> | ||
| < | < | ||
| - | systemctl enable sshd.service | + | systemctl enable sshd # 有効化 |
| - | systemctl disable sshd.service | + | systemctl disable sshd # 無効化 |
| </ | </ | ||
| + | |||
| + | === サービス一覧 === | ||
| + | |||
| + | {{fa> | ||
| + | < | ||
| + | systemctl list-units --type=service | ||
| + | </ | ||
| + | |||
| + | {{fa> | ||
| + | < | ||
| + | systemctl list-unit-files --type=service | ||
| + | </ | ||
| + | |||
| + | === その他 === | ||
| + | |||
| + | {{fa> | ||
| + | < | ||
| + | systemctl daemon-reload | ||
| + | </ | ||
| + | |||
| \\ | \\ | ||