LoginSignup
9
10

More than 1 year has passed since last update.

systemctl daemon-reload って何

Posted at

経緯

snmptt の RPM ファイルをインストールした際、

Warning: snmptt.service changed on disk. Run 'systemctl daemon-reload' to reload units. という出力が出た。

問題

なぜ、この出力が出たのかわからない。

また、 systemctl restart <service-name> では不十分なのか疑問である。

結果

正確な理解ができているかはわからないが、 systemctl restart <service-name> と、 systemctl daemon-reload は、以下のように使い分ければいいと理解した。

systemctl restart <service-name>

設定ファイルを変更したときに実行すると、設定ファイルの変更を反映できる。

systemctl daemon-reload

systemd で管理されている Unit ファイル群に変更が加えられた場合に実行すると、その変更を systemd に反映できる。


RPM ファイルをインストールすると、 RPM ファイルに含まれる場合 Unit ファイルなどもシステムにインストールされる。

インストールされた Unit ファイルを実行中の systemd に変更するためには systemctl restart snmptt.service では足りず、 systemctl daemon-reload の実行が必要となる。

daemon-reload

Reload the systemd manager configuration. This will rerun all generators (see systemd.generator(7)),
reload all unit files, and recreate the entire dependency tree. While the daemon is being reloaded, all
sockets systemd listens on behalf of user configuration will stay accessible.

This command should not be confused with the reload command.

関連リンク

9
10
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
9
10