問題
/etc/systemd/system の下 マウント ユニット ファイルは「test.mount」という名前で作成されました。作成されるマウント ポイント ディレクトリは /home/test です。 「Where=」のマウント ユニット ファイル オプションの下 」 構成されたマウント ポイントは /home/test です。ファイルシステムがマウントされるデバイスは /dev/xvdb1 で、「What=」で定義されています " オプション。ファイルシステムをマウントするようにマウント ユニット ファイルを構成すると、次のエラーで失敗します:
# systemctl start test.mount Failed to start test.mount: Unit is not loaded properly: Invalid argument. See system logs and 'systemctl status test.mount' for details.
# systemctl status test.mount ● test.mount - Test Mount Units Loaded: error (Reason: Invalid argument) Active: inactive (dead) Where: /home/test What: /dev/xvdb1
/var/log/messages ファイルに同じエラーが表示されます:
Mar 20 15:34:19 [vm_name] systemd: test.mount's Where= setting doesn't match unit name. Refusing.
解決策
/etc/systemd/system の下のマウント ユニットのマウント ユニット ファイル名が正しくありません。 systemd.mount の man ページによると:
# man systemd.mount ... Where= Takes an absolute path of a directory of the mount point. If the mount point does not exist at the time of mounting, it is created. This string must be reflected in the unit filename. (See above.) This option is mandatory.
上記のマニュアル ページのセクションに示されているように、マウント ユニットは、それらが制御するマウント ポイント ディレクトリに基づいて名前を付ける必要があります。例:マウント ポイント /home/john は、ユニット ファイル home-john.mount で構成する必要があります。文字「/」は「-」のように変更する必要があることに注意してください
マウント ファイル ユニットの名前を test.mount から正しい名前に変更します。 home-test.mount へ .再度テストして、マウント ユニットを取り付けます。
# systemctl start home-test.mount # mount | grep test /dev/xvdb1 on /home/test type ext4 (rw,relatime,seclabel,data=ordered)
エラーで失敗した状態の Squid サービス:「Failed to make swap directory /var/spool/squid/00:(13) Permission denied」
Syslog クライアントの各メッセージを別のファイルに分割する方法 (CentOS/RHEL 6 および 7)