systemdマウントは起動時にのみマウントされ、その後は再マウントできません。

systemdマウントは起動時にのみマウントされ、その後は再マウントできません。

マウントを作成し、mnt-stoneshare.mount次の場所に配置しました/etc/systemd/system

[Unit]
Description=StoneOS Storage Mount

[Mount]
What=/dev/disk/by-uuid/62721034-29ee-4894-a19e-905bcbb20c7c
Where=/mnt/stoneshare

[Install]
WantedBy=local-fs.target

このファイルは、私が開発しているソフトウェアのインストーラによって自動的に生成されます。

明らかに、インストール後(システムが実行されている)systemctl start /mnt/stoneshareまたは同等の機能でインストールを開始しようとすると、systemctl start mnt-stoneshare.mountデバイスは失敗しませんが、インストールは発生しません。確認してみるとjournalctl変な点があります。

Nov 22 20:28:12 stone-development-arch systemd[367]: Unmounted /mnt/stoneshare.
Nov 22 20:28:12 stone-development-arch systemd[367]: Unmounting /mnt/stoneshare...
Nov 22 20:28:12 stone-development-arch systemd[367]: Unit mnt-stoneshare.mount is bound to inactive service. Stopping, too.
Nov 22 20:28:12 stone-development-arch kernel: EXT4-fs (md127): mounted filesystem with ordered data mode. Opts: (null)

最初にインストールされたと表示されますが(したがって終了コードが0であると仮定しますmount)、すぐに削除されます。

確認するとsystemctl status /mnt/stoneshareエラーはありません。

[root@stone-development-arch StoneOS.RaidProcess]# systemctl status /mnt/stoneshare/
● mnt-stoneshare.mount - StoneOS Storage Mount
   Loaded: loaded (/etc/systemd/system/mnt-stoneshare.mount; enabled)
   Active: inactive (dead) since Sat 2014-11-22 20:28:12 EET; 4min 11s ago
    Where: /mnt/stoneshare
     What: /dev/disk/by-uuid/62721034-29ee-4894-a19e-905bcbb20c7c
  Process: 855 ExecMount=/bin/mount -n /dev/disk/by-uuid/62721034-29ee-4894-a19e-905bcbb20c7c /mnt/stoneshare -t auto (code=exited, status=0/SUCCESS)

systemctl enable /mnt/stoneshare私のインストーラもアクティブ化後にデバイスを起動しようとしています。システムを再起動すると、デバイスが正しくインストールされます。デバイスを停止して削除し、デバイスを起動して再インストールしようとすると、同じエラーが発生します。

私のデバイス構成に問題があると思いますが、systemd初心者なので解決策が見つからないようです。

私はすべて読んだ問題はここにありますしかし、それは本当ではないようです。
しかも私も通り過ぎた。RedHatでこのエラーが発生しました。ただし、UUIDおよびその他すべては正確であり、起動時にインストールが実行されるとインストールが実行されます。すでに経験したその他 郵便役に立たない。

マウントを手動で実行すると、マウントがすぐにマウント解除されるのはなぜですか?

ベストアンサー1

マブソサ、本当に失敗しました。以前のテストで/etc/systemd/user矛盾する結果が出ました。

明らかに、systemdデバイスがログインしているユーザーコンテキストで実行されると、/etc/systemd/userディレクトリが優先されます。これが手動マウントでは失敗しますが、起動時には機能する理由です。

ユーザーの名前空間からユニットを削除すると、手動インストールの問題も解決されます。

おすすめ記事