0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Linuxのサービス管理

Last updated at Posted at 2019-11-22

はじめに

CentOS7でyumインストールされたパッケージのサービス管理情報がどこにまとめられているか調べ直した。

CentOS7のサービス管理

CentOS6まではchkconfigコマンドで管理してきたが、CentOS7からはsystemctlコマンドを使って管理するようになった。

systemdの情報が管理されているディレクトリ

/etc/systemd/ディレクトリ以下にsystemdが利用する情報が管理されている。

デフォルトターゲットの確認方法

CentOS6までのデフォルトランレベルに相当するのがデフォルトターゲット。マルチユーザー(ランレベル3)の時に起動するユニットが何を元にして選択されているか調べるには get-defaultオプションを使用する。

$ systemctl get-default
multi-user.target

/etc/systemd/system/multi-user.target.wantsディレクトリ以下に必要なサービス群が登録される。

ユニットの自動起動について

httpdを例にsystemdから自動起動するユニットとして登録してみる。

ユニットの自動起動登録

$ systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target/wants/httpd.service to /usr/lib/systemd/system/httpd.service.

ユニットの自動起動確認

$ systemctl is-enabled httpd
enabled

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?