私のsystemd "Requires ="ステートメントが無視されるのはなぜですか?

私のsystemd

Requires=マウントデバイス(run-netns-vpn.mount)があるにもかかわらず、systemdはそのデバイスがアクティブになる前にまだサービスを開始します! ?

[Unit]
Description=Sets up networking in VPN namespace
Requires=run-netns-vpn.mount
After=run-netns-vpn.mount

[Service]
Type=oneshot
WorkingDirectory=/usr/namespaces
ExecStart=/usr/namespaces/vpn-network-setup.sh

[Install]
WantedBy=multi-user.target

次のサービス状態は次のとおりですrun-netns-vpn.mount

vpn-ns-setup.service - Sets up networking in VPN namespace
   Loaded: loaded (/lib/systemd/system/vpn-ns-setup.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2018-10-07 16:36:34 BST; 2min 46s ago
  Process: 762 ExecStart=/usr/namespaces/vpn-network-setup.sh (code=exited, status=1/FAILURE)
 Main PID: 762 (code=exited, status=1/FAILURE)

Oct 07 16:36:34 mediabox vpn-network-setup.sh[762]: + ip netns exec vpn ip rule add from 10.200.1.2 table 200
Oct 07 16:36:34 mediabox vpn-network-setup.sh[762]: Cannot open network namespace "vpn": No such file or directory
Oct 07 16:36:34 mediabox systemd[1]: vpn-ns-setup.service: Main process exited, code=exited, status=1/FAILURE
Oct 07 16:36:34 mediabox systemd[1]: vpn-ns-setup.service: Failed with result 'exit-code'.
Oct 07 16:36:34 mediabox systemd[1]: Failed to start Sets up networking in VPN namespace.

この状態ですrun-netns-vpn.mount

● run-netns-vpn.mount - /run/netns/vpn
   Loaded: loaded
   Active: active (mounted) since Sun 2018-10-07 16:36:47 BST; 3min 52s ago
    Where: /run/netns/vpn
     What: nsfs

起動時に提供して16:36:34ロードします16:36:47。私はa)サービスがインストールを待ち、b)サービスを開始できない場合は失敗したいと思います。

参考までに:

Linux mediabox 4.15.0-36-generic #39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

なぜこれが起こるのですか?

ベストアンサー1

おすすめ記事