将 `/etc/systemd/system` conf 添加到 nftables 时出现 `bad-setting (原因:单元 nftables.service 有一个坏的单元文件...`

将 `/etc/systemd/system` conf 添加到 nftables 时出现 `bad-setting (原因:单元 nftables.service 有一个坏的单元文件...`

系统是debian 10,带nftables,
我打算做nftalbes失败时自动重启,脚本如下:

cat << EOF >> /etc/systemd/system/nftables.service.d/override.conf
[Service]
Restart=on-failure
RestartSec=1s
EOF

systemctl daemon-reload

输出显示bad-setting

systemctl status nftables.service

nftables.service - nftables
   Loaded: bad-setting (Reason: Unit nftables.service has a bad unit file settin
  Drop-In: /etc/systemd/system/nftables.service.d
           └─override.conf
   Active: active (exited) since Sat 2021-07-24 18:57:51; 1h 13min ago
     Docs: man:nft(8)
           http://wiki.nftables.org
           man:nft(8)
           http://wiki.nftables.org
 Main PID: 2145 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   Memory: 0B
   CGroup: /system.slice/nftables.service

哪里有问题?

相关内容