Translated message

A translation of this page exists in English.

Systemd がレガシー tmpfile の場所 /var/run に関する警告をログに記録する

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 8
  • Systemd バージョン systemd-239 以降
  • また、/var/run を参照するすべてのパッケージ。注記: 以下のパッケージリストには、影響を受ける既知のパッケージが含まれていますが、このリストに限定されるものではありません。

    • libstoragemgmt-1.6.2-9.el8.x86_64
    • mdadm-4.1-4.el8.x86_64
    • net-snmp-5.8-7.el8.x86_64
    • radvd-2.17-12.el8.x86_64
    • subscription-manager-1.23.8-35.el8.x86_64
    • krb5-libs-1.18.2-8.el8
    • 389-ds-base-1.4
    • IPA
    • unbound-1.7.3-8.el8
    • certmonger

Issue

systemd-tmpfiles-clean.service が開始されるたびに、複数のメッセージがログに出力されます。

    May 13 17:55:57 rhel8 systemd[1]: Starting Cleanup of Temporary Directories...
    May 13 17:55:57 rhel8 systemd-tmpfiles[31007]: [/usr/lib/tmpfiles.d/<PACKAGE NAME>.conf:1] Line references path below legacy directory /var/run/, updating /var/run/<PATH> → /run/<PATH>; please update the tmpfiles.d/ drop-in file accordingly.

Resolution

注記: このメッセージは情報提供用であり、操作の失敗を示すものではありません。

  • systemd が変更されたため、ログの削除を試みるには、/var/run を使用するパッケージを更新する必要があります。
  • 以下は、ログに対応する更新を含むパッケージとそのエラータの包括的なリストです。

  • /var/run/<FILE>/ の場所を提供するパッケージを特定するには、以下のコマンドを実行すると、指定されたファイルを提供しているすべてのパッケージのリストが表示され、更新を実行することで、更新後に警告が発生しなくなるかどうかを調べることができます。

    # dnf whatprovides /var/run/<FILE>/
    # dnf whatprovides /var/run/rhsm    # this is an example and should list the subscription-manager package
    

回避策

  • 以下のコマンドは、一時的な回避策として使用できます。これは、/etc/tmpfiles.d/* の下に、正しいパスで対応する設定ファイルを作成します。

    # sed "s/\/var\/run\//\/run\//g" /usr/lib/tmpfiles.d/<PACKAGE NAME>.conf > /etc/tmpfiles.d/<PACKAGE NAME>.conf
    
    • 以下の例では、pesign パッケージの設定を変更します。

      # systemctl restart systemd-tmpfiles-clean.service    # reproduces the logs
      
      # journalctl -a -b 0 | grep 'Line references'    # find the warning log
      Sep 10 13:46:46 r8 systemd-tmpfiles[738]: [/usr/lib/tmpfiles.d/pesign.conf:1] Line references path below legacy directory /var/run/, updating /var/run/pesign → /run/pesign; please update the tmpfiles.d/ drop-in file accordingly.
      
      # sed "s/\/var\/run\//\/run\//g" /usr/lib/tmpfiles.d/pesign.conf > /etc/tmpfiles.d/pesign.conf    # change the config
      
      # systemctl restart systemd-tmpfiles-clean.service    # reproduces the logs if not changed
      
      # journalctl -a -b 0 | grep 'Line references'    # we only see the prior log and not a new one!
      Sep 10 13:46:46 r8 systemd-tmpfiles[738]: [/usr/lib/tmpfiles.d/pesign.conf:1] Line references path below legacy directory /var/run/, updating /var/run/pesign → /run/pesign; please update the tmpfiles.d/ drop-in file accordingly.
      
    • 回避策がターゲット環境に実装された場合、必要なパッケージに対応するエラータが公開された後、設定ファイル /etc/tmpfiles.d/<PACKAGE NAME>.conf を削除することを検討してください。

Root Cause

  • アップストリームの github systemd commit では、tmpfiles の /var/run の使用に関する通知レベルのログ警告が導入され、tmpfiles が行をマージする方法との競合も修正されました。
  • /var/run/ は、/run に完全にシンボリックリンクされているため、確実にレガシーなディレクトリーですが、systemd 以外でも引き続き使用できます。そのため、正常なままとなります。
  • 多くのアプリケーションスタックやパッケージは、/var/tmp を引き続き参照しているため、ログに対応するための更新が必要です。

Diagnostic Steps

この問題は、以下の手順で簡単に再現できます。

  1. systemd-tmpfiles-clean.service を再起動します。

    # systemctl restart systemd-tmpfiles-clean.service
    
  2. 続いて、ログを確認します。

    • rsyslog を使用するシステムの場合:

      # grep "Line references path below legacy directory /var/run/" /var/log/messages
      May 17 14:54:20 rhel8 systemd-tmpfiles[30687]: [/usr/lib/tmpfiles.d/mdadm.conf:1] Line references path below legacy directory /var/run/, updating /var/run/mdadm → /run/mdadm; please update the tmpfiles.d/ drop-in file accordingly.
      
    • 他のシステムの場合:

      # journalctl -a -b 0 | grep 'Line references'
      Sep 10 13:46:46 r8 systemd-tmpfiles[738]: [/usr/lib/tmpfiles.d/pesign.conf:1] Line references path below legacy directory /var/run/, updating /var/run/pesign → /run/pesign; please update the tmpfiles.d/ drop-in file accordingly.
      

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments